Sudipta Nayak
commited on
Commit
·
cb6b69f
1
Parent(s):
81536c9
issues fix-1
Browse files- app/main.py +8 -8
app/main.py
CHANGED
|
@@ -30,18 +30,18 @@ async def root(request: Request):
|
|
| 30 |
|
| 31 |
|
| 32 |
@app.post("/detect/", response_class=HTMLResponse)
|
| 33 |
-
async def detect_objects(request: Request,
|
| 34 |
try:
|
| 35 |
-
print('Item:', item)
|
| 36 |
|
| 37 |
-
print('File name:', item.file.filename)
|
| 38 |
|
| 39 |
-
input_file = f"uploads/{item.file.filename}"
|
| 40 |
-
output_file = f"static/output/{item.file.filename}"
|
| 41 |
|
| 42 |
-
# Save the uploaded file
|
| 43 |
-
with open(input_file, "wb") as file:
|
| 44 |
-
|
| 45 |
|
| 46 |
print('Detect start')
|
| 47 |
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
@app.post("/detect/", response_class=HTMLResponse)
|
| 33 |
+
async def detect_objects(request: Request, file: UploadFile):
|
| 34 |
try:
|
| 35 |
+
# print('Item:', item)
|
| 36 |
|
| 37 |
+
# print('File name:', item.file.filename)
|
| 38 |
|
| 39 |
+
# input_file = f"uploads/{item.file.filename}"
|
| 40 |
+
# output_file = f"static/output/{item.file.filename}"
|
| 41 |
|
| 42 |
+
# # Save the uploaded file
|
| 43 |
+
# with open(input_file, "wb") as file:
|
| 44 |
+
# file.write(item.file.file.read())
|
| 45 |
|
| 46 |
print('Detect start')
|
| 47 |
|