jebin2 commited on
Commit
c5942cc
·
1 Parent(s): 3678f7c

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(IMAGE_ROOT, "train", file.filename)
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---- #############################