Update app.py
Browse files
app.py
CHANGED
|
@@ -350,26 +350,23 @@ def load_image(image_path):
|
|
| 350 |
# Appliquer le prétraitement
|
| 351 |
img_processed = preprocess_image(img)
|
| 352 |
|
| 353 |
-
# Convertir en RGB pour l'affichage
|
| 354 |
img_rgb = cv2.cvtColor(img_processed, cv2.COLOR_BGR2RGB)
|
| 355 |
-
|
| 356 |
-
|
| 357 |
shared_results["original_image"] = img
|
| 358 |
shared_results["img_rgb"] = img_rgb
|
| 359 |
-
shared_results["img_draw"] =
|
|
|
|
| 360 |
shared_results["corrected_orientation"] = False
|
| 361 |
|
| 362 |
-
# Réinitialiser les
|
| 363 |
shared_results["detection_boxes"] = {
|
| 364 |
"plate": None,
|
| 365 |
"logo": None,
|
| 366 |
"color": None,
|
| 367 |
"orientation": None
|
| 368 |
}
|
| 369 |
-
shared_results["vehicle_box"] = None
|
| 370 |
-
shared_results["vehicle_detected"] = False
|
| 371 |
|
| 372 |
-
# Retourner uniquement l'image originale pour l'affichage
|
| 373 |
return Image.fromarray(img_rgb)
|
| 374 |
|
| 375 |
def detect_vehicle():
|
|
|
|
| 350 |
# Appliquer le prétraitement
|
| 351 |
img_processed = preprocess_image(img)
|
| 352 |
|
|
|
|
| 353 |
img_rgb = cv2.cvtColor(img_processed, cv2.COLOR_BGR2RGB)
|
| 354 |
+
img_draw = img_rgb.copy()
|
| 355 |
+
|
| 356 |
shared_results["original_image"] = img
|
| 357 |
shared_results["img_rgb"] = img_rgb
|
| 358 |
+
shared_results["img_draw"] = img_draw
|
| 359 |
+
shared_results["video_processing"] = False
|
| 360 |
shared_results["corrected_orientation"] = False
|
| 361 |
|
| 362 |
+
# Réinitialiser les boîtes de détection
|
| 363 |
shared_results["detection_boxes"] = {
|
| 364 |
"plate": None,
|
| 365 |
"logo": None,
|
| 366 |
"color": None,
|
| 367 |
"orientation": None
|
| 368 |
}
|
|
|
|
|
|
|
| 369 |
|
|
|
|
| 370 |
return Image.fromarray(img_rgb)
|
| 371 |
|
| 372 |
def detect_vehicle():
|