diff --git a/src/objectifier.py b/src/objectifier.py index 575be73..4bbe662 100644 --- a/src/objectifier.py +++ b/src/objectifier.py @@ -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")