Open Baicheng42 opened 5 months ago
The 'obj_id' represents the annotation ID corresponding to the target in the frame. You can refer to the annotation information to add the corresponding key and value.
It seems that the "obj_id" is the "id" of of "object" in XML.
But i find another when there is no target in a frame, the JOSN file generated by "1generate_json.py" will not have any target information, result in the problem of augmentation.
File "/home/kiki/A/hxc/track/MP2Net/lib/dataset/coco_icpr.py", line 240, in __getitem__ img, _, bbox_tol, cls_id_tol, ids_tol, pre_bboxes, pre_ids = self.aug(img, img, bbox_tol, cls_id_tol, ids_tol, pre_bboxes, pre_ids) File "/home/kiki/A/hxc/track/MP2Net/lib/utils/augmentations.py", line 605, in __call__ img, img_fg, boxes, labels, ids, pre_boxes, pre_ids = self.augment(img, img_fg, boxes, labels, ids, pre_boxes, pre_ids) File "/home/kiki/A/hxc/track/MP2Net/lib/utils/augmentations.py", line 79, in __call__ img, img_fg, boxes, labels, ids, pre_boxes, pre_ids = t(img, img_fg, boxes, labels, ids, pre_boxes, pre_ids) ValueError: not enough values to unpack (expected 7, got 5)
In this case, should I remove the images that do not contain the target in the training set or add some information when generating the josn file?
Could I ask how did you solve do it?
@Jianfantasy, in my case, I have not encountered this error. I think there are two ways to address it:
Option 1: Remove the images without a target. Option 2: Modify the code related to Line 239 by adding a check. If there are not enough values, you can simply assign the value using np.empty().
Hope this finds you well.
It seems that the "obj_id" is the "id" of of "object" in XML. But i find another when there is no target in a frame, the JOSN file generated by "1generate_json.py" will not have any target information, result in the problem of augmentation.
File "/home/kiki/A/hxc/track/MP2Net/lib/dataset/coco_icpr.py", line 240, in __getitem__ img, _, bbox_tol, cls_id_tol, ids_tol, pre_bboxes, pre_ids = self.aug(img, img, bbox_tol, cls_id_tol, ids_tol, pre_bboxes, pre_ids) File "/home/kiki/A/hxc/track/MP2Net/lib/utils/augmentations.py", line 605, in __call__ img, img_fg, boxes, labels, ids, pre_boxes, pre_ids = self.augment(img, img_fg, boxes, labels, ids, pre_boxes, pre_ids) File "/home/kiki/A/hxc/track/MP2Net/lib/utils/augmentations.py", line 79, in __call__ img, img_fg, boxes, labels, ids, pre_boxes, pre_ids = t(img, img_fg, boxes, labels, ids, pre_boxes, pre_ids) ValueError: not enough values to unpack (expected 7, got 5)
In this case, should I remove the images that do not contain the target in the training set or add some information when generating the josn file?Could I ask how did you solve do it?
Hello, Thank you for your great work! I followed "1generate_json.py" from https://satvideodt.github.io/ and https://github.com/zf020114/SatVedioDTkit to prepare "instances_val_caronly.json" and I used my json to train the model. But I got an error:
I compared the difference between your json and my json, and found that there are not obj_id in my json.
Therefore, could you kindly teach me how to prepare the obj_id in instances_val_caronly.json? Thanks again!!!
Best wishes!