-
Notifications
You must be signed in to change notification settings - Fork 5
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
How to do Object Detection in Kolena - Task Doc Template #583
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #583 +/- ##
==========================================
- Coverage 94.53% 93.61% -0.92%
==========================================
Files 86 86
Lines 5359 5359
Branches 782 782
==========================================
- Hits 5066 5017 -49
- Misses 217 256 +39
- Partials 76 86 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
With the task-metrics page, there could be redundancies cleared up within the OD guide. Would love to hear thoughts on what should be added/removed to a How-To guide (as this would likely become a template to other guides), particularly for where the How-To guides would live in the table of contents. |
docs/dataset/object-detection.md
Outdated
inferences for an image are the labeled bounding boxes having confidence scores (the model's certainty of | ||
correctness), as if the model annotated the image. | ||
|
||
??? info "Evaluation Metrics for Object Detection Models: Precision, Recall, F1-Score, and AP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be in a collapsible section? It's a bit odd to me that I don't see any list of metrics when I come to the metrics section of the docs. I normally use these collapsible callouts when there are information that doesn't need to be but nice to have on the page.
It's fine to keep some details in the callout for further learning but we should at least list the metrics in the main paragraph of the section. Right now the paragraph just looks incomplete as it doesn't really talk about the metrics.
docs/dataset/object-detection.md
Outdated
</figure> | ||
|
||
Rather than uploading raw inferences with metrics yourself, if you upload the | ||
[TP / FP / FN](../metrics/tp-fp-fn-tn.md) results from your own [bounding box matcher](../metrics/geometry-matching.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from using their own bounding box matcher, we can also mention our util functions that can compute the necessary model results columns from raw inference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should surface these two options (1. use your own bbox matcher and give us the TP / FP / FN results and 2. upload your raw inferences and use Kolena's bbox matcher) very clearly under the step #3 section.
One thing I am on the fence about is whether or not formatting of data needs to more in depth. If so, would that be within the @y27choi What if it was very code-snippet example-based to reduce the overhead of linking to example code? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@munkyshi I went over it again and left some comments to address. I think we can improve the "Using Kolena to Evaluate Object Detection Models" section to be more clear but I'm curious to hear your thoughts on this. If you are new to Kolena, does this section make sense?
docs/dataset/object-detection.md
Outdated
[`List[ScoredLabeledBoundingBox]`](../reference/annotation.md#kolena.annotation.ScoredLabeledBoundingBox). | ||
Note that a [`ScoredLabeledBoundingBox`](../reference/annotation.md#kolena.annotation.ScoredLabeledBoundingBox) | ||
has an extra `score` attribute for the confidence of the model: | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this format as an example could be overwhelming for users. Is this example necessary?
docs/dataset/object-detection.md
Outdated
{""top_left"": ... ""label"": ""car"", ""score"": 0.94, ""data_type"":""ANNOTATION/BOUNDING_BOX""} | ||
``` | ||
|
||
The expected CSV format for model results should look like the CSV below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this conflict with this API doc? It's confusing to me whether I should have a column called raw_inferences
or TP
/ FP
/ FN
or both. Just like the step #1, it might bet better to just point to the formatting doc.
docs/dataset/object-detection.md
Outdated
For this example, we will upload object detection model results | ||
of [YOLO X](https://github.com/Megvii-BaseDetection/YOLOX) for the single class object detection task in the web app, | ||
and upload the results of [Faster R-CNN](https://github.com/facebookresearch/Detectron) for the | ||
multiclass object detection task through the SDK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like it now includes the uploading of both models in the SDK tab. I believe the intention here is to show examples of both single class and multiclass OD but I think it might be worth focusing on a single class in this example and potentially adding a separate section in future for multiclass for things like "how to view per-class metrics? / how to plot different graphs per class?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed -- let's keep it simple.
docs/dataset/object-detection.md
Outdated
</figure> | ||
|
||
Rather than uploading raw inferences with metrics yourself, if you upload the | ||
[TP / FP / FN](../metrics/tp-fp-fn-tn.md) results from your own [bounding box matcher](../metrics/geometry-matching.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should surface these two options (1. use your own bbox matcher and give us the TP / FP / FN results and 2. upload your raw inferences and use Kolena's bbox matcher) very clearly under the step #3 section.
docs/dataset/object-detection.md
Outdated
It's also important to note down the evaluation configuration of the model being uploaded, for example: | ||
`iou_threshold: 0.5` or `iou_threshold: 0.3`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like this part isn't clear enough -- we should either drop it for brevity, or flesh it out (in this example, there should be an eval config with iou_threshold
, min_confidence_score
, and threshold_strategy
-- we don't really touch on them outside of the short blurb you have for iou_threshold
)
docs/dataset/object-detection.md
Outdated
|
||
### Step 2: Upload your Object Detection Dataset | ||
|
||
Model evaluation on Kolena starts with datasets. Upload your dataset of datapoints (e.g. locators to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datasets
can probably link to https://docs.kolena.com/dataset/core-concepts/#dataset
docs/dataset/object-detection.md
Outdated
[uploading object detection model results](../dataset/advanced-usage/dataset-formatting/computer-vision.md#uploading-model-results). | ||
|
||
```shell | ||
poetry run python3 object_detection_2d/upload_results.py faster_rcnn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poetry run python3 object_detection_2d/upload_results.py faster_rcnn | |
uv run python3 object_detection_2d/upload_results.py faster_rcnn |
docs/dataset/object-detection.md
Outdated
[Open Images](https://paperswithcode.com/dataset/open-images-v7), | ||
and [ImageNet](https://paperswithcode.com/dataset/imagenet). | ||
|
||
## Object Detection Model Evaluation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably best to not have OD in every header, given that the page is for OD already
## Object Detection Model Evaluation | |
## Model Evaluation |
docs/dataset/object-detection.md
Outdated
It is important to understand some core performance metrics and plots that are typically seen when | ||
evaluating object detection models. | ||
|
||
### Object Detection Metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Object Detection Metrics | |
### Metrics |
docs/dataset/object-detection.md
Outdated
Read the [averaging methods](../metrics/averaging-methods.md) guide if you are not familiar with "macro" | ||
and "micro" terminology. | ||
|
||
### Object Detection Plots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Object Detection Plots | |
### Plots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small comments, but approving to unblock merge after they are addressed.
Linked issue(s)
Fixes KOL-5750
What change does this PR introduce and why?
The beginning of a series of How-to guides in Kolena. This one is for object detection.
Will need thoughts on document organization. From this thread, I think all future
How-to
's would live under the quickstart page.Quickstart > How to test Object Detection models