Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounding box annotation #48

Closed
thomassajot opened this issue Jan 22, 2020 · 10 comments
Closed

Bounding box annotation #48

thomassajot opened this issue Jan 22, 2020 · 10 comments
Assignees

Comments

@thomassajot
Copy link

A useful feature for object detection is to define the bounding box (or even polygon) around one or many objects in an image.

@thomassajot
Copy link
Author

thomassajot commented Jan 22, 2020

Keeping the prediction made by the model on the remaining images would speed up the labelling process.
This UI is build using jupyter-innotater
image

@janfreyberg
Copy link
Owner

Hi,

thanks for raising this! I am actually currently working on this. I'm developing the bounding box / polygon interface here: https://ipyannotations.readthedocs.io/en/latest/

For the integration, really the only thing missing is to document it. If you want to try it, you can do:

pip install superintendent ipyannotations

then run this in a notebook:

from ipyannotations import PolygonAnnotator
from superintendent.base import Labeller

input_widget = PolygonAnnotator(classes=["pigeon"])

labeller = Labeller(
    features=["img/vdnkh.jpg"],  # your list of images
    input_widget=input_widget,
    display_func=input_widget.display
)

labeller

@thomassajot
Copy link
Author

thomassajot commented Jan 23, 2020

Hi,

This is great !
I believe the classes argument of PolygonAnnotator should be called options.

Unfortunately I did not manage to display the image.

from ipyannotations import PolygonAnnotator
from superintendent.base import Labeller

input_widget = PolygonAnnotator(options=["pigeon"])

labeller = Labeller(
    features=["my_image.jpg"],
    input_widget=input_widget,
    display_func=input_widget.display
)

labeller

image

Would you know about this issue ?

@janfreyberg
Copy link
Owner

Yes, you're right, that's a mistake on my side.

I'm not sure why the image is not displaying... is the image stored in the same directory as the notebook you're working in?

And if you have an older version of jupyter notebook installed, you may have to also run this command:
jupyter nbextension enable --py --sys-prefix ipycanvas

(see here )

@thomassajot
Copy link
Author

Installing the extension solves the display issue.
Thanks !

@thomassajot
Copy link
Author

There is a subsequent bug.
Running the code once creates a labeller.new_labels with one element in the list [None]
Running the code a second time, labeller.new_labels is now a list of two elements [None, None]

@janfreyberg
Copy link
Owner

OK, thanks for letting me know - I'll take a look

@janfreyberg janfreyberg self-assigned this Jan 23, 2020
@janfreyberg
Copy link
Owner

I've figured it out, it's a silly bug on my part. I'm pushing a fix now, plus some documentation of this example!

@janfreyberg
Copy link
Owner

This bug is now fixed (see https://github.com/janfreyberg/superintendent/releases/tag/0.5.1) - make sure to upgrade to the latest version from PyPI. As part of this release I also added documentation for using ipyannotations widgets: https://superintendent.readthedocs.io/en/latest/modularity.html

@thomassajot
Copy link
Author

Great ! Thank you for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants