Cartucho / OpenLabeling

Label images and video for Computer Vision applications
Apache License 2.0
926 stars 265 forks source link

Image not load when pressing "D" on MacOS #17

Closed n5ken closed 5 years ago

n5ken commented 6 years ago

I am using Mac High Sierra v10.13.2 when I press "D" to the next page, the track bar moves to the next item but the image is still the previous one, it works well on Ubuntu.

Cartucho commented 6 years ago

And changing the class, for example, works? Pressing "W" or "S"

n5ken commented 6 years ago

Yes, changing the class works, I will try to reproduce this bug on others Mac, this might be a CV (3.4.1) bug I guess.

n5ken commented 6 years ago

A workaround for this bug temporary:

        cv2.setTrackbarPos(TRACKBAR_IMG, WINDOW_NAME, img_index)
        change_img_index(img_index)
Cartucho commented 6 years ago

I think it is an OpenCV bug, actually, I was thinking about removing the OpenCV dependency at all and use the python default one (Tkinter).

robsalasco commented 6 years ago

+1 I have this bug too! hope you can fix it :)

Cartucho commented 6 years ago

@robsalasco thank you for your report! Are you also using a Macbook?

robsalasco commented 6 years ago

@Cartucho yep I'm using macOS too

chris3240 commented 5 years ago

Same with me. I can change the classes, but not the images. However, labeling files get created for each image

Cartucho commented 5 years ago

Can you try changing in the code to another letter? pressed_key == ord('d'),

for example, you could try changing it to pressed_key == ord('e')

chris3240 commented 5 years ago

Doesn't change anything. If I press D, the bar of the selected image is moving, but the same image is displayed. Yesterday it somehow worked for one try, but after that I had the same issue. Can't reproduce this

chris3240 commented 5 years ago

I get a message in my console "OpenCV: Couldn't read video stream from file "input/.DS_Store"". I'm trying to label .jpg images, no video frames.

n5ken commented 5 years ago

I get a message in my console "OpenCV: Couldn't read video stream from file "input/.DS_Store"". I'm trying to label .jpg images, no video frames.

You can try my workaround to remove call back from cv2.createTrackbar(...)

n5ken commented 5 years ago

Can you try changing in the code to another letter? pressed_key == ord('d'),

for example, you could try changing it to pressed_key == ord('e')

I tried before but with no luck

chris3240 commented 5 years ago

Okay, I think I found the solution. I call set_img_index(img_index) after decreasing, or increasing the index right before 1035: cv2.setTrackbarPos(TRACKBAR_IMG, WINDOW_NAME, img_index)

Cartucho commented 5 years ago

cool! so it works now?

Cartucho commented 5 years ago

@n5ken @chris3240 do you think you could give it a try now? (maybe re-clone the repo in another directory)

chris3240 commented 5 years ago

Yeah, it works. Thanks for providing this tool and your help!