-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
026da82
commit 5e1c7d7
Showing
4 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ | |
async def upload_image(request: Request, | ||
files: List[UploadFile] = File(...), | ||
source: Optional[str] = Query(None, description='Source of the image'), | ||
creation_date: Optional[str] = Query(None, description='Creation date of the image')): | ||
creation_date: Optional[str] = Query(None, description='Creation date of the image'), | ||
upload_priority: bool = Query(False, description='Upload the image with priority')): | ||
""" | ||
Upload an image or multiple images to the learning loop. | ||
|
@@ -21,9 +22,9 @@ async def upload_image(request: Request, | |
Example Usage | ||
curl -X POST -F '[email protected]' "http://localhost:/upload?source=test&creation_date=2024-01-01T00:00:00" | ||
curl -X POST -F '[email protected]' "http://localhost:/upload?source=test&creation_date=2024-01-01T00:00:00&upload_priority=true" | ||
""" | ||
raw_files = [await file.read() for file in files] | ||
node: DetectorNode = request.app | ||
await node.upload_images(raw_files, source, creation_date) | ||
await node.upload_images(raw_files, source, creation_date, upload_priority=upload_priority) | ||
return 200, "OK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters