waspinator / pycococreator

Helper functions to create COCO datasets
Apache License 2.0
765 stars 179 forks source link

When visualizing with own images: ValueError: cannot reshape array of size 5 into shape (2,2) #2

Closed BennoStaub closed 5 years ago

BennoStaub commented 6 years ago

Hey, I recreated the steps with my own image as attached. Adapting your shapes_to_coco.py script by changing class names it worked. However, in the last step of visualizing them with your jupyter notebook (there is an error, the annotation_file is not in the annotations dir but in the train dir) I get the following error: ValueError: cannot reshape array of size 5 into shape (2,2). Screenshot is attached too. screenshot from 2018-04-18 15-11-08

1_cube_3 1_cuboid_2 1_triangle_1 1

Maybe we can discuss this in detail via mail to speed up fixing it: staubbe@student.ethz.ch

waspinator commented 6 years ago

Thanks for reporting the issue. This is a bug in when contours have fewer than three points. I'll push a fix soon.

waspinator commented 6 years ago

Try installing pycococreatortools from master and rerunning your script. The notebook should work now.