Skip to content

Commit

Permalink
Update SDK version, convert coords to pixel before validation #3
Browse files Browse the repository at this point in the history
  • Loading branch information
cxnt authored Nov 4, 2024
2 parents a9981c6 + 38c7066 commit 336d93c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
32 changes: 16 additions & 16 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"type": "app",
"version": "2.0.0",
"name": "Figures Validator",
"description": "Service for validating figures geometry",
"docker_image": "supervisely/base-py-sdk:6.73.128",
"categories": ["images"],
"icon": "",
"icon_cover": true,
"headless": false,
"poster": "",
"entrypoint": "python -m uvicorn src.main:app --host 0.0.0.0 --port 8000",
"port": 8000,
"context_menu": {
"target": ["images_project", "ecosystem"]
},
"instance_version": "6.10.0"
"type": "app",
"version": "2.0.0",
"name": "Figures Validator",
"description": "Service for validating figures geometry",
"docker_image": "supervisely/base-py-sdk:6.73.221",
"categories": ["images"],
"icon": "",
"icon_cover": true,
"headless": false,
"poster": "",
"entrypoint": "python -m uvicorn src.main:app --host 0.0.0.0 --port 8000",
"port": 8000,
"context_menu": {
"target": ["images_project", "ecosystem"]
},
"instance_version": "6.12.1"
}
3 changes: 2 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def validate_figures(orig_req: Request, req: ValidationReq):
geometry_changed = True
break
else:
geometry = shape.from_json(data_json)
data_in_px = shape._to_pixel_coordinate_system_json(data_json, img_size)
geometry = shape.from_json(data_in_px)
geometry_bbox = geometry.to_bbox()

# check figure is within image bounds
Expand Down

0 comments on commit 336d93c

Please sign in to comment.