Spaces:
Sleeping
Sleeping
TheAlly commited on
Commit ·
1c7ee64
1
Parent(s): 930ecb7
Initial BirdNET server setup
Browse files- Dockerfile +18 -0
- README.md +8 -6
- requirements.txt +1 -0
Dockerfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
# System libs BirdNET-Analyzer needs for audio decoding
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
+
ffmpeg libsndfile1 && \
|
| 6 |
+
rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
# HF Spaces requires non-root user
|
| 9 |
+
RUN useradd -m -u 1000 user
|
| 10 |
+
USER user
|
| 11 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 12 |
+
|
| 13 |
+
WORKDIR /home/user/app
|
| 14 |
+
COPY --chown=user:user requirements.txt .
|
| 15 |
+
RUN pip install --no-cache-dir --user -r requirements.txt
|
| 16 |
+
|
| 17 |
+
EXPOSE 7860
|
| 18 |
+
CMD ["python", "-m", "birdnet_analyzer.server", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: SS BirdNet
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: green
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
-
|
| 8 |
-
short_description: BirdNet Audio Analysis API
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: SS BirdNet API
|
| 3 |
+
emoji: 🐦
|
| 4 |
colorFrom: green
|
| 5 |
+
colorTo: yellow
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# SS BirdNet API
|
| 11 |
+
|
| 12 |
+
BirdNET-Analyzer wrapped as an HTTP endpoint via its built-in `birdnet_analyzer.server` module. POST multipart audio to the analyze endpoint and get species predictions as JSON.
|
| 13 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
birdnet-analyzer
|