Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework repo, add support for Rectangle shape, upgrade supervisely version #16

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
/debug
.venv
src/debug
secret_debug.env
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"PYTHONPATH": "${workspaceFolder}:${PYTHONPATH}"
}
}
]
}
35 changes: 35 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"files.exclude": {
"**/__pycache__": true,
"build": true,
"supervisely.egg-info": true,
".venv": true
},
"python.defaultInterpreterPath": ".venv/bin/python",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"black-formatter.args": [
"--line-length",
"100"
],
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
},
"debug.inlineValues": "off",
"python.analysis.typeCheckingMode": "off",
"python.analysis.autoImportCompletions": false,
"autoDocstring.docstringFormat": "sphinx",
"autoDocstring.customTemplatePath": "docs/.mustache",
"python.testing.pytestArgs": [
"tests/inference_cache"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Converts [Supervisely](https://docs.supervise.ly/data-organization/00_ann_format


## Preparation
There are special requirements for Supervisely project, classes must have `Polygon` or `Bitmap` shape, all other shapes will be skipped. It means that only labeled objects with these shapes will be rendered as masks.

There are special requirements for input Supervisely project, classes must have `Polygon`, `Bitmap` or `Rectangle` shape, all other shapes will be skipped. Only objects with `Polygon` and `Bitmap` shapes will be rendered as masks.

Pascal VOC format stores all data in separate folders. Image classes bounding boxes and additional information are stored in `.xml` files. Segmentantion class and object masks are placed into `SegmentationClass` and `SegmentationObject` folders respectively. **All image Tags, except `train` and `val` will be skipped**.

Expand Down Expand Up @@ -135,6 +136,6 @@ App creates task in `workspace tasks` list. Once app is finished, you will see d

<img src="https://i.imgur.com/MTjig3H.png"/>

Resulting archive is saved in :
Resulting archive is saved in:

`Current Team` -> `Files` -> `/pascal_voc_format/<task_id>/<project_id>_<project_name>_pascal_format.tar`.
49 changes: 22 additions & 27 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
{
"name": "Export to Pascal VOC",
"type": "app",
"categories": [
"images",
"export"
],
"description": "Converts Supervisely Project to Pascal VOC format",
"docker_image": "supervisely/import-export:0.0.5",
"instance_version": "6.5.1",
"main_script": "src/export-pascal-voc.py",
"modal_template": "src/modal.html",
"modal_template_state": {
"pascalContourThickness": 3,
"trainSplitCoef": 0.8
},
"task_location": "workspace_tasks",
"icon": "https://i.imgur.com/zTseThz.png",
"icon_background": "#FFFFFF",
"headless": true,
"context_menu": {
"target": [
"images_project"
],
"context_root": "Download as"
},
"poster": "https://user-images.githubusercontent.com/48245050/182382862-d74f1b2c-b19e-47c2-84db-45cd934ec34e.png"
}
"name": "Export to Pascal VOC",
"type": "app",
"categories": ["images", "export"],
"description": "Converts Supervisely Project to Pascal VOC format",
"docker_image": "supervisely/import-export:6.72.147",
"instance_version": "6.5.1",
"main_script": "src/main.py",
"modal_template": "src/modal.html",
"modal_template_state": {
"pascalContourThickness": 3,
"trainSplitCoef": 0.8
},
"task_location": "workspace_tasks",
"icon": "https://i.imgur.com/zTseThz.png",
"icon_background": "#FFFFFF",
"headless": true,
"context_menu": {
"target": ["images_project"],
"context_root": "Download as"
},
"poster": "https://user-images.githubusercontent.com/48245050/182382862-d74f1b2c-b19e-47c2-84db-45cd934ec34e.png"
}
19 changes: 0 additions & 19 deletions debug.env

This file was deleted.

2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
supervisely==6.68.109
supervisely==6.72.147
lxml==4.6.3
numpy>=1.19.4
Pillow>=8.0.1
15 changes: 15 additions & 0 deletions local.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
PYTHONUNBUFFERED=1

LOG_LEVEL="debug"

TASK_ID=44728

context.teamId=8
context.workspaceId=349
modal.state.slyProjectId=22451

modal.state.pascalContourThickness=3
modal.state.trainSplitCoef=0.8

DEBUG_APP_DIR="src/debug/app_debug_data"
DEBUG_CACHE_DIR="src/debug/app_debug_cache"
Loading