Spaces:
Sleeping
Sleeping
Update tasks/image.py
Browse files- tasks/image.py +3 -3
tasks/image.py
CHANGED
|
@@ -16,7 +16,7 @@ load_dotenv()
|
|
| 16 |
router = APIRouter()
|
| 17 |
|
| 18 |
#MODEL_TYPE = "YOLOv11n"
|
| 19 |
-
DESCRIPTION = f"YOLOv8n model with batch
|
| 20 |
|
| 21 |
ROUTE = "/image"
|
| 22 |
|
|
@@ -122,9 +122,9 @@ async def evaluate_image(request: ImageEvaluationRequest):
|
|
| 122 |
#PATH_TO_MODEL = 'models/best_YOLOv11n_1280_real_half.onnx'
|
| 123 |
PATH_TO_MODEL = 'models/best_YOLOv8n.pt'
|
| 124 |
INFERENCE_ENGINE_TYPE = 'pt'
|
| 125 |
-
INPUT_SIZE =
|
| 126 |
N_TEST_BATCHES = 2
|
| 127 |
-
BATCH_SIZE =
|
| 128 |
|
| 129 |
def preprocessor(frame):
|
| 130 |
#frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) # Only when read from file
|
|
|
|
| 16 |
router = APIRouter()
|
| 17 |
|
| 18 |
#MODEL_TYPE = "YOLOv11n"
|
| 19 |
+
DESCRIPTION = f"YOLOv8n model with batch 8 inference on CPU"
|
| 20 |
|
| 21 |
ROUTE = "/image"
|
| 22 |
|
|
|
|
| 122 |
#PATH_TO_MODEL = 'models/best_YOLOv11n_1280_real_half.onnx'
|
| 123 |
PATH_TO_MODEL = 'models/best_YOLOv8n.pt'
|
| 124 |
INFERENCE_ENGINE_TYPE = 'pt'
|
| 125 |
+
INPUT_SIZE = 640
|
| 126 |
N_TEST_BATCHES = 2
|
| 127 |
+
BATCH_SIZE = 8 # Can be adjusted as needed
|
| 128 |
|
| 129 |
def preprocessor(frame):
|
| 130 |
#frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) # Only when read from file
|