Skip to content

Commit

Permalink
Merge pull request #166 from vietanhdev/fix/crash_on_load_model
Browse files Browse the repository at this point in the history
Fix for loading model configs
  • Loading branch information
vietanhdev authored Dec 20, 2023
2 parents e7fb9ca + 55338bf commit 28a5a7f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ anylabeling/data
/wheels_dist
*_ui.py
anylabeling/app_info.py-*
zipped_models/*
zipped_models/*
venv/
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Python Module",
"type": "python",
"request": "launch",
"module": "anylabeling.app",
"justMyCode": true
},
{
"name": "Profile Python Module",
"type": "python",
"request": "launch",
"module": "cProfile",
"args": ["-o", "profile_output.prof", "-m", "anylabeling.app"],
"justMyCode": true
}
]
}
4 changes: 4 additions & 0 deletions anylabeling/services/auto_labeling/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ def _load_model(self, model_id):
# Download and extract model
if not model_config.get("has_downloaded", True):
model_config = self._download_and_extract_model(model_config)
if model_config is None:
return

self.model_configs[model_id].update(model_config)

if model_config["type"] == "yolov5":
from .yolov5 import YOLOv5
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-r requirements.txt
build
twine
black
2 changes: 1 addition & 1 deletion scripts/format_code.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
black -l 79 --exclude="tests/|anylabeling/resources/resources.py" .
black -l 79 --exclude="tests/|anylabeling/resources/resources.py|venv/" .

0 comments on commit 28a5a7f

Please sign in to comment.