Skip to content

Commit

Permalink
Bug fix in Navigation Detection to prevent spamming crash reports whe…
Browse files Browse the repository at this point in the history
…n the code is unable to delete the previous AI model.
  • Loading branch information
Glas42 committed Jun 4, 2024
1 parent ae7b8ab commit cd2cac6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion blog/V1.11.Minor.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ title: Version 1.11 > Minor
This changelog will contain all changes from 1.11.0 onwards before the next major version.
!!!


==- Version 1.11.31
Bug fix in Navigation Detection to prevent spamming crash reports when the code is unable to delete the previous AI model.
[!badge variant="dark" text="Glas42"] [!badge variant="ghost" text="NavigationDetection"]
==- Version 1.11.30
It's now possible to collect anonymous traffic light images for a new AI model.
[!badge variant="dark" text="Glas42"] [!badge variant="ghost" text="TrafficLightDetection"]
Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
It's now possible to collect anonymous traffic light images for a new AI model.
Bug fix in Navigation Detection to prevent spamming crash reports when the code is unable to delete the previous AI model.
7 changes: 7 additions & 0 deletions plugins/NavigationDetection/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,13 @@ def DeleteAllAIModels():
for file in os.listdir(f"{variables.PATH}plugins/NavigationDetection/AIModel"):
if file.endswith(".pt"):
os.remove(os.path.join(f"{variables.PATH}plugins/NavigationDetection/AIModel", file))
except PermissionError:
global TorchAvailable
TorchAvailable = False
settings.CreateSettings("NavigationDetection", "UseAI", False)
print(f"NavigationDetection - PermissionError in function DeleteAllAIModels: {ex}")
print("NavigationDetectionAI will be automatically disabled because the code cannot delete the AI model.")
console.RestoreConsole()
except Exception as ex:
exc = traceback.format_exc()
SendCrashReport("NavigationDetection - Error in function DeleteAllAIModels.", str(exc))
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.30
1.11.31

0 comments on commit cd2cac6

Please sign in to comment.