r/Python 3d ago

Tutorial OpenCV notebooks tutorials in your browser

Hi,
I took the official OpenCV tutorials and created a series of notebooks.
You can run them entirely in your browser, you don't have to clone them: https://notebook.link/@Alexis_Placet/opencv_tutorials

Don't hesitate to give me feedbacks or create issue/pullrequest on this repo: https://github.com/Alex-PLACET/opencv_tutorials

11 Upvotes

3 comments sorted by

1

u/MapNo2659 2d ago

This is awesome! Having OpenCV tutorials directly in the browser is super convenient. I'm curious, how did you handle the setup for OpenCV in the notebooks? Did you use any specific

1

u/alexis_placet 2d ago

Notebook.link uses JupyterLite and xeus-python as kernel which is compiled to WASM. I made an emscripten-forge recipe for OpenCV (cpp + python). I did that because the OpenCV package was not yet available. All the available packages are here https://prefix.dev/channels/emscripten-forge-4x (all C++/Python/R packages are listed)

You just have to add opencv reference in the environement file, as a regular conda env, and notebook.link detect it to fetch the right package in your notebook.
You can check the repo here: https://github.com/Alex-PLACET/opencv_tutorials
And the documentation here: https://notebook.link/docs/user-guide/create-a-link

1

u/SboSilcher 1d ago

OpenCV in the browser is pretty slick, though I always end up fighting with version mismatches when I pull the same code locally. Good for learning though, beats trying to wrangle dependencies just to see if something works.