humphrem / action Goto Github PK
View Code? Open in Web Editor NEWAutomated Camera Trapping Identification and Organization Network (ACTION)
License: Apache License 2.0
Automated Camera Trapping Identification and Organization Network (ACTION)
License: Apache License 2.0
Would we be able to add a feature to pause while action is running through a large file, and then play to resume from that same point? We wouldn't want more than one paused session at once. If resuming a paused session, it would need to ignore the -d.
I wanted to start a discussion about whether or not to break the actions.py
file into smaller files or leave it as one.
If I was doing this on my own, I'd break it up. However, I don't want to impose my style of working on you if it would be easier to have everything in one file.
If I did this, I'd probably end up with files like:
action.py <-- our main file that you'd run
ui.py <-- functions related to drawing the rectangles and other "user interface" stuff
model.py <-- functions related to working with YOLO-fish, doing detections, etc
utils.py <-- miscellaneous functions that don't belong anywhere else
The action.py
file would import
functions from these other files, so it would become quite short. However, to find things, you'd have to jump around between files, which you might find confusing.
Let me know what you think. I can go either way, but want this code to be something you can navigate and change.
A good example of what a Python project like this would look like is the Birdnet-Analyzer that I'm using to detect birds with my AudioMoth. You can see that it has files like:
analyze.py
audio.py
model.py
species.py
...
You use analyze.py
(like our action.py
) and it uses all the other files.
You might also find their README file interesting to see, as a model for how we could write ours. I think we should put a cool image of fish being detected with bounding boxes in it.
I noticed when I ran the command python action.py ./video/*.mov -c 0.45 -m 4.0 -s -b 1.0 -d
this error message appeared:
Starting file 1 of 3: ./video/20230817_095737_trimmed.mov - 22:23 - 40290 frames at 30.0 fps, skipping every 15 frames
Using confidence threshold 0.45, minimum clip duration of 4.0 seconds, and 1.0 seconds of buffer.
Fish detected, starting detection event: 00:12 (max confidence=88.85%)
Detection period ended: 00:18 (duration=00:06, max confidence=88.85%)
Process Process-1:
Traceback (most recent call last):
File "/Users/MorganHumphrey/action/action.py", line 59, in create_clip_process
clip_filename = f"{get_clips_dir(video_path)}/{(clip_count):03}-{format_time(clip_start_time, '_')}-{format_time(clip_end_time, '_')}{os.path.splitext(video_path)[1]}"
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/MorganHumphrey/action/action.py", line 20, in get_clips_dir
return f"{os.path.splitext(video_path)[0]}_clips"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen posixpath>", line 118, in splitext
TypeError: expected str, bytes or os.PathLike object, not list
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/MorganHumphrey/action/action.py", line 79, in create_clip_process
except queue.Empty:
^^^^^^^^^^^
AttributeError: 'Queue' object has no attribute 'Empty'
Fish detected, starting detection event: 00:30 (max confidence=69.03%)
Detection period ended: 00:36 (duration=00:06, max confidence=69.03%)
Running the action.py command with a file name that doesn't exist causes the program to exit, but does not provide an error message/explanation to the user of what went wrong. It looks like the program just doesn't do anything.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.