Skip to content

Commit

Permalink
Refactor test_predict.py for improved readability and organization
Browse files Browse the repository at this point in the history
- Consolidated parameters in the `get_prediction` function call for cleaner code.
- Moved the import statement for `Yolov5TestConstants` and `download_yolov5n_model` to enhance module organization.

These changes enhance the clarity and maintainability of the test suite for YOLO11 model predictions.
  • Loading branch information
fcakyon committed Dec 16, 2024
1 parent 63cda34 commit d742d11
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/test_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,7 @@ def test_get_prediction_yolo11(self):

# get full sized prediction
prediction_result = get_prediction(
image=image,
detection_model=yolo11_detection_model,
shift_amount=[0, 0],
full_shape=None,
postprocess=None
image=image, detection_model=yolo11_detection_model, shift_amount=[0, 0], full_shape=None, postprocess=None
)
object_prediction_list = prediction_result.object_prediction_list

Expand Down Expand Up @@ -410,8 +406,8 @@ def test_get_sliced_prediction_yolo11(self):
def test_coco_json_prediction(self):
from sahi.predict import predict
from sahi.utils.mmdet import MmdetTestConstants, download_mmdet_yolox_tiny_model
from sahi.utils.yolov5 import Yolov5TestConstants, download_yolov5n_model
from sahi.utils.ultralytics import UltralyticsTestConstants, download_yolo11n_model
from sahi.utils.yolov5 import Yolov5TestConstants, download_yolov5n_model

# init model
download_mmdet_yolox_tiny_model()
Expand Down

0 comments on commit d742d11

Please sign in to comment.