You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a custom dataset that is only composed by 8 keypoints: headneckleft_shoulderright_shoulderleft_elbowright_elbowright_handleft_hand
An example is this image
And I created the JSON with COCO format with only a few images just to try training any model with Coco Annotator. This is an example for the first image.
The problem is that I have no idea how to make it work to train the head of a pretrained model that only outputs this 8 points.
What I did
I followed MMPose_Tutorial.ipynb located in configs/demo. I thought it would work if I made some changes with the config located in configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrnet-w32_8xb64-210e_coco-256x192.py.
The things I have changed are:
# Change the root for the json, because they are located in /home/icksir/Documentos/safetymind/coco-annotator/train.json
# and /home/icksir/Documentos/safetymind/coco-annotator/test.json
cfg.data_root = '/home/icksir/Documentos/safetymind/coco-annotator/'
# I only have like 6 images so I used a really small batch size
cfg.train_dataloader.batch_size = 2
cfg.val_dataloader.batch_size = 2
cfg.test_dataloader.batch_size = 2
# I changed the dataset configs to match my path and indicated that I use CocoDataset
# The images path are in /home/icksir/Documentos/safetymind/coco-annotator/datasets/train/*.jpg
cfg.dataset_type = 'CocoDataset'
cfg.train_dataloader.dataset.type = cfg.dataset_type
cfg.train_dataloader.dataset.ann_file = 'train.json'
cfg.train_dataloader.dataset.data_root = cfg.data_root
cfg.train_dataloader.dataset.data_prefix = dict(img='datasets/train/')
# The images path are in /home/icksir/Documentos/safetymind/coco-annotator/datasets/test/*.jpg
cfg.val_dataloader.dataset.type = cfg.dataset_type
cfg.val_dataloader.dataset.bbox_file = None
cfg.val_dataloader.dataset.ann_file = 'test.json'
cfg.val_dataloader.dataset.data_root = cfg.data_root
cfg.val_dataloader.dataset.data_prefix = dict(img='datasets/test/')
cfg.test_dataloader.dataset.type = cfg.dataset_type
cfg.test_dataloader.dataset.bbox_file = None
cfg.test_dataloader.dataset.ann_file = 'test.json'
cfg.test_dataloader.dataset.data_root = cfg.data_root
cfg.test_dataloader.dataset.data_prefix = dict(img='datasets/test/')
# I indicated that the head must only output 8 channels and the backbone has to have pretrained weights
cfg.model.head.out_channels = 8
cfg.model.backbone.init_cfg['prefix'] = 'backbone.'
What is my error
In the runner.train() function that is created by Runner.from_cfg(cfg), I have one error:
in BaseDataset._serialize_data(self)
np.ndarray = np.cumsum(address_list)
# TODO Check if np.concatenate is necessary
--> data_bytes = np.concatenate(data_list)
# Empty cache for preventing making multiple copies of
# `self.data_info` when loading data multi-processes.
self.data_list.clear()
File <__array_function__ internals>:200, in concatenate(*args, **kwargs)
ValueError: need at least one array to concatenate
I would appreciate any help or how could I approach this dataset.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a custom dataset that is only composed by 8 keypoints:
head
neck
left_shoulder
right_shoulder
left_elbow
right_elbow
right_hand
left_hand
An example is this image

And I created the JSON with COCO format with only a few images just to try training any model with Coco Annotator. This is an example for the first image.
The problem is that I have no idea how to make it work to train the head of a pretrained model that only outputs this 8 points.
What I did
I followed
MMPose_Tutorial.ipynb
located inconfigs/demo
. I thought it would work if I made some changes with the config located inconfigs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrnet-w32_8xb64-210e_coco-256x192.py
.The things I have changed are:
What is my error
In the
runner.train()
function that is created byRunner.from_cfg(cfg)
, I have one error:I would appreciate any help or how could I approach this dataset.
Beta Was this translation helpful? Give feedback.
All reactions