Skip to content

Commit

Permalink
issue #51: Modify /inf endpoint to receive area_ratio and color_forma…
Browse files Browse the repository at this point in the history
…t from frontend
  • Loading branch information
MaxenceGui committed Apr 8, 2024
1 parent 4870244 commit 683bf6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ async def inference_request():
imageDims = data["imageDims"]
image_base64 = data["image"]

area_ratio = data.get("area_ratio", 0.5)
color_format = data.get("color_format", "hex")

print(f"Requested by user: {container_name}") # TODO: Transform into logging
pipelines_endpoints = CACHE.get("pipelines")
blob_service_client = app.config.get("BLOB_CLIENT")
Expand Down Expand Up @@ -207,7 +210,7 @@ async def inference_request():
print("Process results") # TODO: Transform into logging

processed_result_json = await inference.process_inference_results(
cache_json_result[-1], imageDims
cache_json_result[-1], imageDims, area_ratio, color_format
)

result_json_string = json.dumps(processed_result_json)
Expand Down
1 change: 1 addition & 0 deletions docs/nachet-model-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ seeds.
},
"label": "top_label_name",
"score": 0.912,
"color": "#ff0",
"topN": [
{
"score": 0.912,
Expand Down

0 comments on commit 683bf6a

Please sign in to comment.