Sudipta Nayak
commited on
Commit
·
59f0d7a
1
Parent(s):
79424d9
no message
Browse files- app/main.py +5 -2
app/main.py
CHANGED
@@ -47,8 +47,8 @@ async def detect_objects(request: Request, file: UploadFile):
|
|
47 |
print('Detect start')
|
48 |
|
49 |
# Run YOLOv7 detection and save output
|
50 |
-
|
51 |
-
|
52 |
|
53 |
print('Detect end')
|
54 |
|
@@ -58,9 +58,12 @@ async def detect_objects(request: Request, file: UploadFile):
|
|
58 |
|
59 |
original_image_path = f"../static/{file.filename}"
|
60 |
output_image_path = f"../static/output/exp/{file.filename}"
|
|
|
61 |
|
62 |
print('original_image path :', str(original_image_path))
|
63 |
print('output_image_path path :', str(output_image_path))
|
|
|
|
|
64 |
|
65 |
# Render HTML using Jinja2Templates
|
66 |
return templates.TemplateResponse(
|
|
|
47 |
print('Detect start')
|
48 |
|
49 |
# Run YOLOv7 detection and save output
|
50 |
+
subprocess.run(["python", "app/detect.py", "--conf", "0.5", "--img-size", "640", "--weights", "app/model/best.pt", "--no-trace",
|
51 |
+
"--source", str(input_file_path), "--save-txt", "--save-conf", "--exist-ok", "--project", str(output_file_path)], check=True)
|
52 |
|
53 |
print('Detect end')
|
54 |
|
|
|
58 |
|
59 |
original_image_path = f"../static/{file.filename}"
|
60 |
output_image_path = f"../static/output/exp/{file.filename}"
|
61 |
+
output_image_path_1 = f"../static/output/{file.filename}"
|
62 |
|
63 |
print('original_image path :', str(original_image_path))
|
64 |
print('output_image_path path :', str(output_image_path))
|
65 |
+
print('file size :', os.path.getsize(output_image_path))
|
66 |
+
print('file size :', os.path.getsize(output_image_path_1))
|
67 |
|
68 |
# Render HTML using Jinja2Templates
|
69 |
return templates.TemplateResponse(
|