Skip to content

Wild demo#84

Open
kgarwoodsdzwa wants to merge 75 commits into
devfrom
wild_demo
Open

Wild demo#84
kgarwoodsdzwa wants to merge 75 commits into
devfrom
wild_demo

Conversation

@kgarwoodsdzwa
Copy link
Copy Markdown
Member

No description provided.

kgarwoodsdzwa and others added 30 commits November 16, 2023 14:15
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
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
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add display_num to this example

TypeError: DisplayInfo.init() missing 1 required positional argument: 'display_num'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Comment thread cougarvision_utils/get_images.py Outdated
info['file_thumb_url'], stripped_name])

# not sure what unlabeled output should be
unlabeled_img = config.path_to_unlabeled_output
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we dont need this anymore? the display function calls the config.save_dir to get the images, where they include the datetime

@kgarwoodsdzwa
Copy link
Copy Markdown
Member Author

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.
So we should see if we can use cv2 to have a black display window inherently, with a predefined grid. where it's ok if the display screen is black at first, it will fill up with new images as they come in. but only populating the squares needed. ie, if you have 2 labeled images only, it will be a black screen, except for the top upper left and top middle positions of the 9x9 grid will have the 2. and if a 3rd comes in, it would refresh to have the entire top row filled. if that makes sense.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants