Wild demo#84
Conversation
updating wild demo to reflect master
Revert "updating wild demo to reflect master"
The demo branch was created hard and fast and these commits make the demo portion more modular in the sense that with merely a few extra lines to the config, you can make fetch_and_alert run the necessary portions to allow the output to be visualized. Currently, one must run this version of fetch_and_alert and simultaneously run display.py with the same config file as fetch and alert to work. display.py is the main function and visualize_helper.py contain some functions that get called in fetch_and_alert to ensure the images are in the proper place and format for display.py to reach them.
Was called visualize_output now called visualize_helper
The script was not writing the log to a file, only to the terminal and was logging duplicated lines. It needed to be initialized before calling the classifier and detector initializers because when those got called first, they introduced their own logging handlers that overrode the one I created. Also the force=True needed to be added so that the log file would actually be created
There's a few "too many variables" and "unable to import" errors but I'm ignoring those
We trained a new model 'southwest_v3.pt' that performs better on cougars than the previous model, but the animl-py on pypi can only handle h5 models. Cougarvision had to be updated to be compatible with the updates that have been made to animl-py on github where there exists the capability to use .pt models. It was mostly function name changes and movement, and the updates only affected fetch_and_alert.py for loading the classifier model and detect_img.py.
The example config file was missing some of the parameters needed by cougarvision wild_demo update. This config file now exposes the color for the bounding box, sending email alerts, the time between fetch_and_alert function call, and changed the names of the config values for dev and consumer emails.
There was an old animl function called parse_results that prepared the classification output for alert sending this has been depricated and that old function is no longer necessary
the example config needed to be updated to reflect changes
wild_demo had animl_update created based off wild_demo, need to be merged before pr to master
…ision into animl_update
previously adding this to the path was in detect_img for some reason
all the config and logging and loading was just happening when the script ran but it should just happen in main
there is important documentation about the different api calls you can do from strikeforce, but it should be clearly stored in the docstring and not in a floating comment in the middle
before this whole script was not nested in functions at all. One of the things this pr does is make fetch and alert into functions, but we werent passing the correct variables to the functions but now we are
…nfigInfo dataclass.
There was a problem hiding this comment.
need to add display_num to this example
TypeError: DisplayInfo.init() missing 1 required positional argument: 'display_num'
There was a problem hiding this comment.
I actually had to copy this file to /cougarvision because it would not run while it was in /cougarvision/cougarvision_visualize due to this error:
Traceback (most recent call last):
File "/home/katiegarwood/cougarvision/cougarvision_visualize/display.py", line 31, in
from cougarvision_utils.get_info import DisplayInfo
ModuleNotFoundError: No module named 'cougarvision_utils'
| info['file_thumb_url'], stripped_name]) | ||
|
|
||
| # not sure what unlabeled output should be | ||
| unlabeled_img = config.path_to_unlabeled_output |
There was a problem hiding this comment.
seems like we dont need this anymore? the display function calls the config.save_dir to get the images, where they include the datetime
|
I can't submit a legit "review" because i am the one that started the pull request, but i did leave some comments! I also think that it would be nice to actually have the display set up slightly differently for the labeled images. i mentioned using a black set of images if you don't have all the required 9 for it to work- but im realizing that could get tricky because of how we sort the images to display. if the black image someone inserts doesn't have the proper datetime format in the filename that we're using to sort, it will error out. If we can implement this, we should also do it for the unlabeled image display output, but i think higher priority is to do this for the labeled display. |
No description provided.