Lesson 2: more interactivity in notebooks

Hi all, this is my second post. Encouraged by the helpful response I got last time, and by the truly stellar fast.ai code style and documentation.

I am trying to introduce more interactivity into the notebook environment. Specifically I would like to be able to draw and move bounding boxes on top of images. I looked into ipywidgets and they didn’t have anything like this out of the box.

I want to run a loop with img.show(y=bbox), passing in new bbox parameters as they are updated by mouse events. Does anyone know if something like this already exists for notebooks? What is a good way to handle mouse events? I tried using OpenCV, but that’s not going to work for me:

> cv2.imshow() is disabled in Colab, because it causes Jupyter sessions
> to crash

I’d really appreciate some feedback on this issue. In the meantime I can dig through the ipywidgets source for hints, and will update you all if I find a solution.

All righty, I just found that the same people who make ipywidgets also make ipyevents. When I get this functionality up and running, I’ll be happy to share the notebook.

You can also use from google.colab.patches import cv2_imshow for google colab

Ah! I was not aware of that. Thank you.

In the meantime I decided that, while Jupyter notebooks are a fabulous tool, they are not the right tool for everything. I was able to work much faster on this particular problem with text editor + console on my machine.

So if anyone was looking forward to this functionality in a notebook – sorry! I won’t be the one to do it.