Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env: requirements.txt add matplotlib dependency for gui #526

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

kenshih
Copy link
Contributor

@kenshih kenshih commented Dec 11, 2024

In this PR matplotlib was added in order to allow running of birdnet_analyzer.gui thus avoiding errors such as this:

BirdNET-Analyzer git:(main) ✗ python -m birdnet_analyzer.gui
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/gui/__main__.py", line 5, in <module>
    import birdnet_analyzer.gui.train as train
  File "/Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/gui/train.py", line 7, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

This is a follow up to #525. Thank you, @Josef-Haupt for looking at and your feedback on that PR!

Tested on:
Python: 3.11.11
OS: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:14 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8103 arm64

python -m birdnet_analyzer.gui

Used this to analyze a Virgina Rail .m4a file that I recorded today nearby.

Screenshot 2024-12-12 at 9 35 12 AM Screenshot 2024-12-12 at 9 35 21 AM

Thank you for your consideration! Ken

In this PR `matplotlib` was added in order to allow running of `birdnet_analyzer.gui` thus avoiding errors such as this:

```
BirdNET-Analyzer git:(main) ✗ python -m birdnet_analyzer.gui
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/gui/__main__.py", line 5, in <module>
    import birdnet_analyzer.gui.train as train
  File "/Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/gui/train.py", line 7, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
```

This is a follow up to kahst#525. Thank you, @Josef-Haupt for looking at and your feedback on that PR!
@kenshih
Copy link
Contributor Author

kenshih commented Dec 12, 2024

Also double-checked...

$ python -m birdnet_analyzer.analyze --i /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/ --o /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/ --slist /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/ --min_conf 0.5 --threads 4
…
Finished /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/soundscape.wav in 1.70 seconds

$ cat birdnet_analyzer/example/soundscape.BirdNET.selection.table.txt 
Selection       View    Channel Begin Time (s)  End Time (s)    Low Freq (Hz)   High Freq (Hz)        Common Name     Species Code    Confidence      Begin Path      File Offset (s)
1       Spectrogram 1   1       0       3.0     0       15000   Black-capped Chickadeebkcchi  0.8141  /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/soundscape.wav      0
2       Spectrogram 1   1       9.0     12.0    0       15000   House Finch     houfin0.6394  /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/soundscape.wav      9.0
3       Spectrogram 1   1       42.0    45.0    0       15000   Dark-eyed Junco daejun0.7375  /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/soundscape.wav      42.0
4       Spectrogram 1   1       54.0    57.0    0       15000   House Finch     houfin0.6071  /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/soundscape.wav      54.0
5       Spectrogram 1   1       60.0    63.0    0       15000   Dark-eyed Junco daejun0.5550  /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/soundscape.wav      60.0
6       Spectrogram 1   1       72.0    75.0    0       15000   House Finch     houfin0.5638  /Users/ken/Documents/wk/BirdNET-Analyzer/birdnet_analyzer/example/soundscape.wav      72.0

@Josef-Haupt
Copy link
Collaborator

LGTM

@Josef-Haupt Josef-Haupt merged commit 9bd2b77 into kahst:main Dec 13, 2024
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