Replace matplotlib with much faster OpenCV 3.2 in the show_frame func…#5
Open
Greendogo wants to merge 1 commit intotorrvision:masterfrom
Open
Replace matplotlib with much faster OpenCV 3.2 in the show_frame func…#5Greendogo wants to merge 1 commit intotorrvision:masterfrom
Greendogo wants to merge 1 commit intotorrvision:masterfrom
Conversation
Collaborator
|
Thanks! I think it is OK to introduce a dependency on OpenCV. This may also be useful if we want to do e.g. a live demo using a webcam. |
Author
|
If I wanted to do a live demo using a webcam (provided I already have a groundtruth for my first frame) with the siamese fc tracker, does anyone have any suggestions regarding where to start? |
Author
|
My plan is to attempt to divide Siamfc-tf 's current "tracker" function into three which would be used like so: Any advice on parameters or moving things around in the "tracker" function would be most appreciated! |
hayatibis
reviewed
Aug 10, 2017
| plt.pause(0.001) | ||
| plt.clf() | ||
| #Adjust Color Channels of frame | ||
| frame_adjusted = np.ndarray(shape=(720,1280,3), dtype=np.dtype(np.uint8)) |
There was a problem hiding this comment.
I think this line should be
frame_adjusted = np.ndarray(shape=np.shape(frame), dtype=np.dtype(np.uint8))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tion.
Fixes Issue #4
I went from ~6fps to ~30fps on my machine.
This still requires changes to the "requirements.txt" file and a python module with OpenCV compiled to use imshow and waitKey must be required (currently the popular but unofficial opencv-python module does not implement them).
Since show_frame no longer uses matplotlib and show_crops and show_scores don't look like they're used at all (didn't check everywhere) it looks like the requirement for matplotlib could be removed along with the references to it in visualization.py and tracker.py (in the imports in that file, and on line 135).