PixelLib icon indicating copy to clipboard operation
PixelLib copied to clipboard

Error in coco dataset conversion: labelme2coco updated

Open ZL92 opened this issue 3 years ago • 6 comments

Hello,

The labelme2coco just got updated to v0.2.0. Consequently, the load_dataset() in custom training has an error.

Thanks for your effort in solving it in advance!

ZL92 avatar Jan 10 '22 15:01 ZL92

Hi, just coming here to bump this issue as well. Many thanks for your attention to this problem!

vmshirey avatar Jan 12 '22 20:01 vmshirey

I've looked into it and there are at least two things that changed.

First, labelme2coco.convert now creates "dataset.json" file as output so code in "custom_train/init.py" would have to be changed from: save_json_path1 = os.path.abspath(os.path.join(dataset, "train.json")) self.dataset_train.load_data(save_json_path1, labelme_folder1)

to: save_json_path1 = os.path.abspath(os.path.join(dataset, "coco/train")) self.dataset_train.load_data(os.path.join(save_json_path1, "dataset.json"), labelme_folder1)

Second, labelme2coco now uses zero indexing for coco categories whereas here it is not allowed: print('Error: Class id for "{}" cannot be less than one. (0 is reserved for the background)'.format(class_name))

Most likely there is more, this is just what I've found during a quick search. I don't think that it can be resolved without attention from @ayoolaolafenwa.

Sandell0 avatar Jan 14 '22 00:01 Sandell0

Hi all,

A solution that works for me: install the previous version of labelme2coco.

!pip3 install pixellib --upgrade
!pip3 install labelme2coco==v0.1.2

Hope this would help!

ZL92 avatar Jan 14 '22 09:01 ZL92

Hi all,

A solution that works for me: install the previous version of labelme2coco.

!pip3 install pixellib --upgrade
!pip3 install labelme2coco==v0.1.2

Hope this would help!

I tried the solution. But unfortunately no luck.

Kampmarsvin avatar Feb 17 '22 12:02 Kampmarsvin

The new version didn't work. I had the same problem. Try this setting:

!pip3 install tensorflow==2.4.1
!pip3 install tensorflow--gpu
!pip3 install imgaug
!pip install pixellib --upgrade
!pip install labelme2coco==0.1.2

I used an old version and now is working.

greg007-web avatar Feb 18 '22 19:02 greg007-web

Worked for me.

darlannakamura avatar May 05 '22 19:05 darlannakamura