Skip to content

Commit

Permalink
Merge branch 'main' of Predator
Browse files Browse the repository at this point in the history
  • Loading branch information
connervieira committed Oct 22, 2023
2 parents 8bf8aed + ab42e52 commit 4a306a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ These are the features actively planned for Predator and are likely to be added
- [ ] Complete OpenCV dashcam recording.
- [X] Improve the efficiency of GPS location requests when many requests are made in quick succession.
- [ ] Test that improved GPS location querying behaves as expected.
- [ ] Kill the ALPR process every time Predator starts to ensure there are no unexpected background threads.
- [X] Kill the ALPR process every time Predator starts to ensure there are no unexpected background threads.
- [ ] Re-implement object recogntion to real-time mode using the new back-end.
- [ ] Re-implement image saving in real-time mode using the new-backend.
5 changes: 3 additions & 2 deletions alprstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ def alpr_stream_maintainer(): # This function runs an endless loop that maintain
for plate in message["results"]: # Iterate through each license plate in this line.
queued_plate_reads.append(plate) # Add each license plate to the license plate queue.
else:
display_message("The information returned by the ALPR engine is not valid JSON. Maybe you've specified the wrong ALPR engine in the configuration?", level=3)
display_message("The information returned by the ALPR engine is not valid JSON. Maybe you've specified the wrong ALPR engine in the configuration?", 3)


def start_alpr_stream(): # This function starts the ALPR stream threads.
debug_message("Starting ALPR stream ", thread="ALPRStream")
save_to_file(alpr_stream_file_location, "", True) # Erase the contents of the ALPR stream file.
alpr_stream_count = 0
alpr_stream_count = 0 # This will keep track of the number of ALPR streams running.
alpr_stream_threads = {} # This is a dictionary that will hold the ALPR sub-threads.
os.popen("killall alpr") # Kill any ALPR processes that are running in the background in case they weren't terminated properly the last time Predator was run.
for device in config["realtime"]["image"]["camera"]["devices"]: # Iterate through each device in the configuration.
debug_message("Starting ALPR stream " + str(alpr_stream_count), thread="ALPRStreamMaintainer")
print (device)
Expand Down
3 changes: 1 addition & 2 deletions config.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@
"image": {
"camera": {
"devices": {
"main": "/dev/video0",
"secondary": "/dev/video2"
"primary": "/dev/video2"
}
}
},
Expand Down

0 comments on commit 4a306a3

Please sign in to comment.