Hack the filename + url

This commit is contained in:
niten 2023-01-10 16:21:32 -08:00
parent 9dd9e38eab
commit a312942a0d
1 changed files with 2 additions and 2 deletions

View File

@ -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")