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

docs(notebooks): 📝 json and csv sink cookbooks are added #975

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

onuralpszr
Copy link
Collaborator

Description

New JSON and CSV sink cookbooks are added. For Json it needs a version bump, I used the direct develop branch while preparing it.

JSON collab URL: https://colab.research.google.com/drive/19aqX0QwKXxRk4sYtdEmghO2rzEAKMciM?usp=sharing
CSV collab URL: https://colab.research.google.com/drive/1-qetEcyzrBCOCq-TfVVT8AgUG3rJUhT7?usp=sharing

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
@onuralpszr onuralpszr added the doc:sv:notebooks Supervision Notebook Related Updates label Mar 5, 2024
@onuralpszr onuralpszr self-assigned this Mar 5, 2024
@onuralpszr
Copy link
Collaborator Author

@SkalskiP do you want to merge/review this?

@SkalskiP
Copy link
Collaborator

Hi @onuralpszr 👋🏻, thanks for the reminder.

  • It would be awesome to add some life to those cookbooks. Display images and/or videos. People see that you are downloading the VideoAssets.PEOPLE_WALKING video, but it would be cool to display it. Take a look here for reference.

  • You used supervision==0.19.0rc5 version. Let's bump it to supervision==0.21.0rc5. We rolled out some tracker bugs in supervision==0.20.0.

  • That link https://inference.roboflow.com/reference_pages/model_aliases/ is no longer live.

  • I'd move this 'detections.csv' to constant.

  • You no longer need that. You can use aliases directly.

    REGISTERED_ALIASES = {
        "yolov8n-640": "coco/3",
        "yolov8n-1280": "coco/9",
        "yolov8m-640": "coco/8",
        "yolov8x-1280": "coco/10",
    }
    
  • Call byte_track.reset() after this byte_track = sv.ByteTrack(). Tracker ID's in your CSV start at 180.

  • Use minimum_consecutive_frames=3 in byte_track = sv.ByteTrack(). It will make results more stable.

@onuralpszr
Copy link
Collaborator Author

@SkalskiP thank you for tips let me update all.

@SkalskiP
Copy link
Collaborator

Pleasure 💜

@onuralpszr
Copy link
Collaborator Author

@SkalskiP I updated both collabs in "the links" could you check, after your confirm I will commit all

@onuralpszr
Copy link
Collaborator Author

@SkalskiP friendly reminder ping :)

@LinasKo
Copy link
Collaborator

LinasKo commented May 22, 2024

Hi @onuralpszr , we spoke with Piotr and I'll be reviewing this one

@LinasKo
Copy link
Collaborator

LinasKo commented May 22, 2024

Hi @onuralpszr,

Here's my review comments:

  1. I see you've added byte_track.reset(), but it should instead be called on the next line after sv.ByteTrack(minimum_consecutive_frames=3) construction. We believe ByteTrack relies on global state, so if someone reruns the notebook, simply calling the constructor may not reset it.

  2. I'm not sure our ipynb->docs converter can handle the progress bar element returned in the video download cell. As a precaution, I'd like to remove the output of that cell.

  3. There's an empty line in json notebook:

   # <- empty line here - let's remove it
SOURCE_VIDEO_PATH = download_assets(VideoAssets.PEOPLE_WALKING)
CONFIDENCE_THRESHOLD = 0.5
IOU_THRESHOLD = 0.7
FILE_NAME = "detections.json"
INFERENCE_MODEL = "yolov8n-640"
  1. Generally, it's a great idea to have bonus content, but we don't think UMAP example fits here. Instead, we're thinking of the following:

Sinks allow users to serialize data into formats suitable for sharing with others or storage in the filesystem. We should show the deserialization case too!
1) We've got some detections that we serialize to JSON / CSV.
2) It's great to see that we can read these in pandas.
3) Next, we could show how to form Detections from these. For example, we could pick frame 1, take the columns and pass them to the Detections constructor.
4) An ideal notebook would also show one annotated frame before starting the sink, and one annotated frame with Detections from reading the CSV/JSON, making it obvious that it's the same.

  1. There's an empty block at the end in CSV notebook - let's remove that

  2. Something you're probably already aware of - the html file links to older version of supervision - we should update data-version to 0.21.0.

  3. Since the previous review, the aliases page is back. If we could mention in briefly in one of the markdown blocks, it would be helpful.
    https://inference.roboflow.com/quickstart/aliases/

  4. We should briefly explain Inference Pipeline and link to it. There's two pages. I suggest mentioning "InferencePipeline (reference)" in the explanation

  5. Similarly, let's link to ByteTrack https://supervision.roboflow.com/latest/trackers/ as well.

  6. Did I miss any links? Whenever we use a major roboflow class, we should link to its docs in https://supervision.roboflow.com/ and https://inference.roboflow.com/

Seems like a lot of changes - apologies for the hassle! However, we do wish to equip the devs with the exact tools they need to get their problems solved 😉

Let me know if you have any questions!

@SkalskiP
Copy link
Collaborator

@LinasKo, thanks for putting the list together! 🙏🏻

@LinasKo
Copy link
Collaborator

LinasKo commented May 28, 2024

Hey @onuralpszr,

How's it going? Got any updates for this one?

I know you're pretty busy so no rush 🙂

@onuralpszr
Copy link
Collaborator Author

Hey @onuralpszr,

How's it going? Got any updates for this one?

I know you're pretty busy so no rush 🙂

Check JSON for development in URL, for update html in commit I will do as last, Don't worry I know that problem ;) I will also remove "loading bar" I am very well aware that problem in the beginning ;)

I added docs and changes most of it. I wrote complete convert from json to detections

check only json please, I can do docs changes and others on CSV afterwards (%99 percent same)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc:sv:notebooks Supervision Notebook Related Updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants