Tlaloc-Es / labelme2yolov7segmentation

Conver labelme annotation format to yolov7 annotation format for segmentation.
4 stars 0 forks source link

cannot import name 'LabelMe' from 'datatypes' #1

Closed kndahl closed 1 year ago

kndahl commented 1 year ago

I've installed you library and run this cmd: labelme2yolo --source-path /tmp --output-path /tmp_res and got the following error:

from datatypes import (
ImportError: cannot import name 'LabelMe' from 'datatypes'

in tmp dir I have images (jpg) and annotations (json)

Full log:

Traceback (most recent call last):
  File "/Users/eolika/.pyenv/versions/3.10.3/bin/labelme2yolo", line 5, in <module>
    from labelme2yolo.__main__ import main
  File "/Users/eolika/.pyenv/versions/3.10.3/lib/python3.10/site-packages/labelme2yolo/__main__.py", line 13, in <module>
    from datatypes import (
ImportError: cannot import name 'LabelMe' from 'datatypes' (/Users/eolika/.pyenv/versions/3.10.3/lib/python3.10/site-packages/datatypes/__init__.py)

To fix the following error, change file __main__.py:

from .datatypes import (
    LabelMe,
    OutputPaths,
    Polygon,
    ShapeProcessed,
    ShapesProcessed,
    FileNameAndExtension,
    YoloV7YML,
)

Also its better to mention in README that if you run this command in your working directory, it would not work: sudo labelme2yolo --source-path /tmp --output-path /tmp_res Istead of this run: sudo labelme2yolo --source-path tmp --output-path tmp_res

Tlaloc-Es commented 1 year ago

Hello, the first error should be fixed please check again. about the readme, I will update it.

And of course, feel free to do a Pull Request.

Kind Regards.