Get only preds for one class in RTMPose (same config used as rtm ap10k model) #2444
-
Hi there, I trained a model with 3 Classes it has similair format as ap10k. Therefore I used the config file from ap10k and adjusted only batch size and name of dataset, paths etc. : base = ['/home/nico/PycharmProjects/mmpose/configs/base/default_runtime.py'] #load custom_keys runtimemax_epochs = 420 train_cfg = dict(max_epochs=max_epochs, val_interval=10) optimizeroptim_wrapper = dict( learning rateparam_scheduler = [ automatically scaling LR based on the actual training batch sizeauto_scale_lr = dict(base_batch_size=64) codec settingscodec = dict( model settingsmodel = dict( base dataset settingsdataset_type = 'AP10KDataset' backend_args = dict(backend='local') backend_args = dict(backend='petrel',path_mapping=dict({f'{data_root}': 's3://openmmlab/datasets/pose/ap10k/',f'{data_root}': 's3://openmmlab/datasets/pose/ap10k/'}))pipelinestrain_pipeline = [ train_pipeline_stage2 = [ data loaderstrain_dataloader = dict( hooksdefault_hooks = dict( custom_hooks = [ evaluatorsval_evaluator = dict( The training went well, but I receive only preds for the first class using the inferencer: image_list = get_list_of_images_array('/home/nico/PycharmProjects/opencv/yolov7_multiclass/DG_dataset_01/valid/') create the inferencer using the model aliasinferencer = MMPoseInferencer( The MMPoseInferencer API employs a lazy inference approach,creating a prediction generator when given inputresult_generator = inferencer(image_list, show=False, out_dir = "/home/nico/PycharmProjects/mmpose/work_dirs/rtmpose-m_8xb64-210e-DG_dataset_01-256x256/inferencer") I checked in the training pipeline what the dataloader delivers to the model and all annotations from all classes are in the dataloader. I also discovered with my debugger that the argument det_cat_ids = [1,2,3] that I pass to the inferencer is changed in the inference pipeline to (15, 16, 17, 18, 19, 20, 21, 22, 23) which is read from the file default_det_model.py. I have the suspicious that this could cause the problem, but not sure as the pipeline is quite complex. I would highly appreciate any suggestions or hints! Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
Thanks for using MMPose. If you use the inferencer without specifying the |
Beta Was this translation helpful? Give feedback.
-
Many thx for the swift response! Unfortunately, it doesn't help. Do you have another idea, of what it might be? |
Beta Was this translation helpful? Give feedback.
-
Could you please specify the three classes that were used to train the RTMPose model? |
Beta Was this translation helpful? Give feedback.
-
That's the categories from my .json file: [ { 'id': 1, An here an example of an image annot.: [ { 'area': 24464, FYI: The categories 2 and 3 have actually only one kpt, why they have no skeleton and the remaining 16 kpts are always 0. PS: sry for the bad formatting it don't apply my formatting for some reason. |
Beta Was this translation helpful? Give feedback.
-
The default object detector "RTMDet-m", which has been trained on COCO, unfortunately does not detect the 2nd and 3rd categories. To detect these objects, you may need to train a new object detector. |
Beta Was this translation helpful? Give feedback.
-
oh, I thought that within the training also the detector is trained:') Is there a guide to re-train such a detector "RTMDet-m" ? And where in the config file would I have to put the custom detector? |
Beta Was this translation helpful? Give feedback.
-
Many many thx for your help! |
Beta Was this translation helpful? Give feedback.
The default object detector "RTMDet-m", which has been trained on COCO, unfortunately does not detect the 2nd and 3rd categories. To detect these objects, you may need to train a new object detector.