Hack the filename + url
This commit is contained in:
parent
9dd9e38eab
commit
a312942a0d
|
@ -4,7 +4,7 @@ from detector import Detector
|
|||
from fastapi import FastAPI, HTTPException, Request, UploadFile, File
|
||||
from fastapi.responses import FileResponse
|
||||
from os import listdir, remove
|
||||
from os.path import getatime, splitext
|
||||
from os.path import getatime, splitext, basename
|
||||
from pathlib import Path
|
||||
from threading import Thread
|
||||
from time import sleep
|
||||
|
@ -87,7 +87,7 @@ def result_to_dict(res, base_url):
|
|||
return {
|
||||
"labels": list(map(lambda d: d.label, res.detections)),
|
||||
"detections": list(map(detection_to_dict, res.detections)),
|
||||
"output": base_url + res.outfile,
|
||||
"output": base_url + basename(res.outfile),
|
||||
}
|
||||
|
||||
# @app.put("/images")
|
||||
|
|
Loading…
Reference in New Issue