Spaces:
Running
Running
path issue fix
Browse files
comic_panel_extractor/annorator_server.py
CHANGED
|
@@ -371,10 +371,9 @@ async def upload_image(file: UploadFile = File(...)):
|
|
| 371 |
if not file.content_type.startswith("image/"):
|
| 372 |
raise HTTPException(status_code=400, detail="File must be an image")
|
| 373 |
|
| 374 |
-
file_path = os.path.join(
|
| 375 |
with open(file_path, "wb") as f:
|
| 376 |
f.write(await file.read())
|
| 377 |
-
shutil.copy(file_path, f'{Config.IMAGE_SOURCE_PATH}/{file.filename}')
|
| 378 |
return {"message": f"Uploaded {file.filename} to train set"}
|
| 379 |
|
| 380 |
####################### ----train---- #############################
|
|
|
|
| 371 |
if not file.content_type.startswith("image/"):
|
| 372 |
raise HTTPException(status_code=400, detail="File must be an image")
|
| 373 |
|
| 374 |
+
file_path = os.path.join(Config.IMAGE_SOURCE_PATH, file.filename)
|
| 375 |
with open(file_path, "wb") as f:
|
| 376 |
f.write(await file.read())
|
|
|
|
| 377 |
return {"message": f"Uploaded {file.filename} to train set"}
|
| 378 |
|
| 379 |
####################### ----train---- #############################
|