How can I get the precision, recall, [email protected] of the network prediction using this slicing method? #718
-
Hello fcakyon,in order to detect small targets, I used a lot of 640x640 slice images to train yolov5s(slice image labels are yolov5 format), and then used sahi to take the high-resolution images synthesized for detection(high-resolution images are prediction set, there are no labels).
|
Beta Was this translation helpful? Give feedback.
Replies: 19 comments
-
@Grenaf thanks for your valuable feedback! As you mentioned, you can perform sliced inference, save results in coco result format and evaluate map50 map0.5: 0.95 etc following the steps mentioned here: https://github.com/obss/sahi/issues/182#issuecomment-894101529 |
Beta Was this translation helpful? Give feedback.
-
You have to convert your dataset into coco format before performing |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I have a question. Two prediction methods are used in sahi. When I use the sahi coco evaluate --dataset_json_path dataset.json --result_json_path result.json command, which method will the model choose to evaluate the model。get_prediction() or get_slice_prediction() |
Beta Was this translation helpful? Give feedback.
-
By default, |
Beta Was this translation helpful? Give feedback.
-
You need 2 things:
COCO formatted result json file can be created using |
Beta Was this translation helpful? Give feedback.
-
You are right! |
Beta Was this translation helpful? Give feedback.
-
@Grenaf closing this issue if you dont have any more questions :) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@Grenaf this issue is fixed with: #299 but havent released a new version for sahi yet. You can either install sahi from main branch with: |
Beta Was this translation helpful? Give feedback.
-
Okay, don’t worry, look forward to your new news. |
Beta Was this translation helpful? Give feedback.
-
@Grenaf latest version (0.8.14) is live! |
Beta Was this translation helpful? Give feedback.
-
the result just like this,Is this result normal? Through the visuals_with_gt obtained by the first command, I saw that the model successfully predicted the target. I think the values of map and ap may be abnormal。 |
Beta Was this translation helpful? Give feedback.
-
@Grenaf it means that your category ids in your trained model and coco json dataset does not match. You have to fix the In most cases, mapping category ids from 0 to N solves the issue. If you can provide your model i can tell you the proper category id to name mapping. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
You model is trained with category ids 0-5 but your dataset json contains category ids 1-6. You have to map your category ids in the dataset json to 0-5 to properly perform evaluation. You can use sahi coco utilities to manage that: https://github.com/obss/sahi/blob/main/docs/COCO.md |
Beta Was this translation helpful? Give feedback.
-
I implemented validation with SAHI for YOLO8 💙 If you like it - press ⭐ |
Beta Was this translation helpful? Give feedback.
You model is trained with category ids 0-5 but your dataset json contains category ids 1-6. You have to map your category ids in the dataset json to 0-5 to properly perform evaluation. You can use sahi coco utilities to manage that: https://github.com/obss/sahi/blob/main/docs/COCO.md