Skip to content

Commit

Permalink
Updated TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
connervieira committed Oct 22, 2023
1 parent 4a306a3 commit c917f16
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ Configuration values in this section are settings specific to real-time mode.
- `alert` is a decimal number that determines how long Predator will delay before starting the next round when there is an active alert.
- `normal` is a decimal number that determines how long Predator will delay before starting the next round under normal circumstances.
- `clearing` is a boolean that determines whether or not Predator will clear the output screen between analysis rounds during real-time mode.
- `object_recognition` contains settings related to object recognition in real-time mode.
- `enabled` is a boolean value that enables and disables object recognition in real-time mode.
- This setting does not override the `general>object_recognition>enabled` setting.
- `video_still_path` is an absolute file-path to the image Predator should run object recognition on.
- By default, Phantom stores video stills from the capture device stream to `/dev/shm/phantom-webcam.jpg`, so that is where this setting should point to in most cases.
- `gps` contains settings related to GPS-based features.
- `enabled` is a boolean determines whether GPS features are enabled or disabled.
- `alpr_location_tagging` is a boolean that determines whether or not the current GPS location will be saved to the log file each time a plate is logged.
Expand Down
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ These are the features actively planned for Predator and are likely to be added
- [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.
- [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.
- [X] Re-implement object recogntion to real-time mode using the new back-end.
[ ] Verify object recognition functionality.
23 changes: 22 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@



# If enabled, count how many vehicles are in each frame.
# If enabled, count how many objects are in each frame.
if (config["general"]["object_recognition"]["enabled"] == True):
debug_message("Running object recognition")
print("Running object recognition...")
Expand Down Expand Up @@ -1312,6 +1312,27 @@



# If enabled, run object recognition on the captured frame.
if (config["general"]["object_recognition"]["enabled"] == True and config["realtime"]["object_recognition"]["enabled"] == True): # Check to make sure real-time object recognition is enabled.
debug_message("Running object recognition")
if (config["realtime"]["interface"]["display"]["output_level"] >= 3): # Only display this status message if the output level indicates to do so.
print("Running object recognition...")

image = cv2.imread(config["realtime"]["object_recognition"]["enabled"]) # Load the frame.
object_recognition_bounding_box, object_recognition_labels, object_recognition_confidence = cv.detect_common_objects(image) # Anaylze the image.
objects_identified = str(object_recognition_labels) # Convert the list of objects identified into a plain string.
if (objects_identified != "[]"): # Check to see that there were actually identified objects.
if (config["realtime"]["interface"]["display"]["output_level"] >= 2): # Only display this status message if the output level indicates to do so.
print("Objects identified: " + objects_identified)
export_data = str(round(time.time()*10)/10) + "," + objects_identified + "\n" # Add the timestamp to the export data, followed by the object's detected, followed by a line break to prepare for the next entry to be added later.
if (save_real_time_object_recognition == True): # Check to make sure the user has configured Predator to save recognized objects to disk.
add_to_file(root + "/real_time_object_detection.csv", export_data, silence_file_saving) # Add the export data to the end of the file and write it to disk.

if (config["realtime"]["interface"]["display"]["output_level"] >= 3): # Only display this status message if the output level indicates to do so.
print("Done\n----------")





debug_message("Processing ALPR results")
Expand Down

0 comments on commit c917f16

Please sign in to comment.