[Bug]: small-object-detection-with-sahi notebook fails to run in Colab
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- google-cloud, jupyter-notebook, python
- Domain
- computer-vision, documentation
Research direction
Start with docs/notebooks/small-object-detection-with-sahi.ipynb and review the install, image download, tiling, API key, restart, and NMS cells against the reported Colab environment. The issue gives concrete failures and suggested fixes, though some version behavior is unconfirmed. Re-run the notebook in Colab and confirm it completes with valid before-and-after images and the corrected instructions.
Written by the indexing model from the issue text.
Description
Search before asking
- I have searched the issues and discussions and found no similar bug report.
Bug
While fixing the tile-size printout in this notebook (PR #2937), I ran it end to end in Google
Colab and hit several problems that stop it from running as written. I have not changed any of
them in the PR, so the maintainers can decide how to handle them.
Notebook: docs/notebooks/small-object-detection-with-sahi.ipynb
Environment: Google Colab (Python 3.13), supervision 0.30.9
The notebook's install asks for inference and supervision with no version number. In Colab
today, pip looks at supervision 0.31.6 first, then installs 0.30.9. I assume this is a version
limit from inference, but I have not confirmed it.
1. Install cell leaves Colab unable to restart
The install cell also installs jupyter_compare_view. After "Restart session", Colab reported
"restart failed" and the runtime log ended with:
AttributeError: type object 'TermColors' has no attribute 'Green'
The traceback is in google/colab/_shell_customizations.py. The install log shows
jupyter_compare_view pulling in ipython>=9.15.0 and ipykernel>=7.3.0. I believe that
causes the crash, but this is inferred from the log, not confirmed on a clean runtime.
Removing the package and its import gets past the install and restart. The two cells that call
compare(...) then need another way to show the before and after images.
2. Sample image download fails
The notebook requests a 2560px-wide Wikimedia thumbnail. Wikimedia now returns:
ERROR 400: Use thumbnail sizes listed on https://w.wiki/GHai
With the original file URL and a -U "Mozilla/5.0" user agent, the first retry returned
429 Too Many Requests and a later one succeeded.
3. tile_image helper raises TypeError on supervision 0.30.9
The notebook's tile_image helper calls
sv.InferenceSlicer._generate_offset(..., overlap_ratio_wh=None, ...). On 0.30.9 this fails with:
TypeError: InferenceSlicer._generate_offset() got an unexpected keyword argument 'overlap_ratio_wh'
Removing that argument fixes it. On the develop branch (0.32.0.dev), inference_slicer.py has
no overlap_ratio_wh anywhere. The later cells that call
sv.InferenceSlicer(..., overlap_ratio_wh=None, ...) pass the same argument. I have not run
those cells, so I can't say whether they fail on 0.30.9.
4. API key instruction is ambiguous
The notebook says to retrieve your API key. Roboflow's page lists a Publishable key and a
Private key. Using the Publishable key returns 403 Forbidden, and the error does not say which
key is needed. The notebook should say to use the Private key and store it in Colab Secrets.
5. No restart note, and a wording mismatch
After the install cell, Colab prints:
WARNING: The following packages were previously imported in this runtime:
[PIL,_distutils_hack,numpy,packaging,psutil,pydevd_plugins]
You must restart the runtime in order to use newly installed versions.
The notebook does not tell the reader to restart. Also, the text above the NMS cell says the
overlap ratio is (0.2, 0.2), but the code uses (0.15, 0.15).
Happy to open a follow-up PR for any of these if that helps.
Environment
- Supervision:
- Python:
- OS:
Minimal Reproducible Example
No response
Are you willing to submit a PR?
- Yes I'd like to help by submitting a PR!
- Dominant language
- Python
- Stars
- 51.6k
- Forks
- 5k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 191
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from roboflow/supervision
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
roboflow/supervision#2971 ·
Maintainers usually reply within 1 day
-
[Bug]: DetectionDataset.split loses a train item when len(images) * split_ratio is a whole number (90 images at 0.7 give 62/28, not 63/27)Possibly taken @avanish-garg claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
roboflow/supervision#2968 ·
Maintainers usually reply within 1 day
-
[Bug]: MeanAverageRecall returns 0.0 instead of -1 when there are no targets (whole run or empty size bucket)Possibly taken @MaiAditya claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
roboflow/supervision#2964 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
roboflow/supervision#2950 ·
Maintainers usually reply within 1 day
-
[Feature]: Joint angles and JointAngleAnnotator for KeyPointsPossibly taken @kari-pikkarainen claimed this 6 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
roboflow/supervision#2897 ·
Maintainers usually reply within 1 day
All issues in roboflow/supervision
Similar issues
-
area:core-platform effort:S priority:P3 risk:night-safe status:ready type:test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
randomparity/kdive#3620 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FinanceFlash/unvibecode#760 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
google-research/google-research#3470 ·
Maintainers usually reply within 21 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
mrvautin/ha-workouts#11 ·