Spaces:
Sleeping
Sleeping
Commit ·
469f89c
1
Parent(s): e9d14bd
cloud version
Browse files- .github/workflows/sync_to_hf.yml +22 -0
- .gitignore +1 -1
- Dockerfile +20 -0
- README.md +54 -0
.github/workflows/sync_to_hf.yml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Sync to Hugging Face Hub
|
| 2 |
+
on:
|
| 3 |
+
push:
|
| 4 |
+
branches: [main]
|
| 5 |
+
|
| 6 |
+
# Allows you to run this workflow manually from the Actions tab
|
| 7 |
+
workflow_dispatch:
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
sync-to-hub:
|
| 11 |
+
runs-on: ubuntu-latest
|
| 12 |
+
steps:
|
| 13 |
+
- uses: actions/checkout@v3
|
| 14 |
+
with:
|
| 15 |
+
fetch-depth: 0
|
| 16 |
+
lfs: true
|
| 17 |
+
|
| 18 |
+
- name: Push to hub
|
| 19 |
+
env:
|
| 20 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 21 |
+
# The target is your specific space URL with the token injected
|
| 22 |
+
run: git push --force https://ashandilgith:$HF_TOKEN@huggingface.co/spaces/ashandilgith/piranaware_version3 main
|
.gitignore
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
gcp_key.json
|
| 2 |
__pycache__/
|
| 3 |
-
*.
|
|
|
|
| 1 |
gcp_key.json
|
| 2 |
__pycache__/
|
| 3 |
+
*.pyctemp_audio_uploads/
|
Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.9 (Stable for TensorFlow)
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install audio libraries required by Librosa
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
libsndfile1 \
|
| 10 |
+
ffmpeg \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# Copy your files
|
| 14 |
+
COPY . .
|
| 15 |
+
|
| 16 |
+
# Install Python dependencies
|
| 17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
|
| 19 |
+
# Run Streamlit on Port 7860
|
| 20 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
README.md
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🌊 Piranaware: Acoustic Digital Twin for Marine Engines
|
| 2 |
+
|
| 3 |
+
**Predictive Maintenance / Anomaly Detection System v1.0**
|
| 4 |
+
*Listen to what your engine is telling you—before it breaks.*
|
| 5 |
+
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## 📖 Overview
|
| 9 |
+
Piranaware is an AI-powered diagnostic tool designed for marine vessels. It creates a "Digital Twin" of an engine's acoustic signature using Deep Learning (Autoencoders). By comparing current engine sounds against a healthy baseline, it can detect mechanical degradation (bearing wear, valve drift, misfires) weeks before catastrophic failure.
|
| 10 |
+
|
| 11 |
+
**Deployed on:** Hugging Face Spaces (Docker)
|
| 12 |
+
**Backend:** Google Cloud Platform (Storage)
|
| 13 |
+
**ML Engine:** TensorFlow / Keras
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## 🚀 Key Features
|
| 18 |
+
* **Tri-Sonic Calibration:** Trains distinct models for **IDLE**, **SLOW**, and **FAST** RPM states.
|
| 19 |
+
* **Cloud Sync:** Automatically uploads trained models to secure Google Cloud Storage buckets.
|
| 20 |
+
* **Statistical Thresholding:** Uses dynamic safety limits (`Mean + 2σ`) to filter out false positives.
|
| 21 |
+
* **Mobile First:** Responsive Streamlit interface designed for use in engine rooms.
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
## 🛠️ Tech Stack
|
| 26 |
+
* **Frontend:** Streamlit
|
| 27 |
+
* **ML Core:** TensorFlow, Librosa (Audio Processing), NumPy
|
| 28 |
+
* **Infrastructure:** Docker, Google Cloud Storage (GCS)
|
| 29 |
+
* **CI/CD:** GitHub Actions -> Hugging Face Hub
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## ⚙️ Setup & Installation
|
| 34 |
+
|
| 35 |
+
### Prerequisites
|
| 36 |
+
* Python 3.9+
|
| 37 |
+
* FFmpeg (for audio processing)
|
| 38 |
+
* Google Cloud Service Account Key
|
| 39 |
+
|
| 40 |
+
### 1. Local Development
|
| 41 |
+
```bash
|
| 42 |
+
# Clone the repo
|
| 43 |
+
git clone [https://github.com/your-username/piranaware.git](https://github.com/your-username/piranaware.git)
|
| 44 |
+
cd piranaware
|
| 45 |
+
|
| 46 |
+
# Create virtual environment
|
| 47 |
+
python -m venv venv
|
| 48 |
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
| 49 |
+
|
| 50 |
+
# Install dependencies
|
| 51 |
+
pip install -r requirements.txt
|
| 52 |
+
|
| 53 |
+
# Run the app
|
| 54 |
+
streamlit run app.py
|