Sudipta Nayak
commited on
Commit
·
8ff0421
1
Parent(s):
8713edf
file path corrected
Browse files- app/main.py +8 -2
app/main.py
CHANGED
@@ -38,7 +38,7 @@ async def detect_objects(request: Request, file: UploadFile):
|
|
38 |
print('File name:', file.filename)
|
39 |
|
40 |
input_file_path = f"app/static/{file.filename}"
|
41 |
-
output_file_path = f"app/static/output/
|
42 |
|
43 |
# Save the uploaded file
|
44 |
with open(input_file_path, "wb") as input_file:
|
@@ -52,10 +52,16 @@ async def detect_objects(request: Request, file: UploadFile):
|
|
52 |
|
53 |
print('Detect end')
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
# Render HTML using Jinja2Templates
|
56 |
return templates.TemplateResponse(
|
57 |
"result.html",
|
58 |
-
{"request": request, "original_image":
|
59 |
)
|
60 |
# return templates.TemplateResponse("index.html", {"request": request})
|
61 |
|
|
|
38 |
print('File name:', file.filename)
|
39 |
|
40 |
input_file_path = f"app/static/{file.filename}"
|
41 |
+
output_file_path = f"app/static/output/"
|
42 |
|
43 |
# Save the uploaded file
|
44 |
with open(input_file_path, "wb") as input_file:
|
|
|
52 |
|
53 |
print('Detect end')
|
54 |
|
55 |
+
original_image_path = str(input_file_path)
|
56 |
+
output_image_path = str(output_file_path)+"/exp/"+{file.filename}
|
57 |
+
|
58 |
+
print('original_image path :', original_image_path)
|
59 |
+
print('output_image_path path :', output_image_path)
|
60 |
+
|
61 |
# Render HTML using Jinja2Templates
|
62 |
return templates.TemplateResponse(
|
63 |
"result.html",
|
64 |
+
{"request": request, "original_image": original_image_path, "output_image": output_image_path},
|
65 |
)
|
66 |
# return templates.TemplateResponse("index.html", {"request": request})
|
67 |
|