This paste expires on 2023-04-03 08:10:16.979025. Repaste, or download this paste. . Pasted through web.

@app.get("/list-files/")
async def images(i_dir: str, o_dir: str):
    """ Returns the list of files."""
    spot_detection.input_img_dir = i_dir
    spot_detection.output_img_dir = o_dir
    try:
        spot_detection.check_folders()
    except FileExistsError:
        raise HTTPException(
            status_code=404, detail="Could not find the selected folder.")
    except CountAgenCreationError:
        raise HTTPException(
            status_code=501, detail="Could not create a output folder.")
    files = [asdict(img) for img in spot_detection.list_of_files()]
    return {"items": files}
Filename: None. Size: 618b. View raw, , hex, or download this file.