Spaces:
Sleeping
Sleeping
Mohan Rao Boddu commited on
Commit Β·
4a87503
1
Parent(s): 1daba48
Fix HuggingFace folder structure
Browse files- ml-backend-with-image/Dockerfile β Dockerfile +0 -0
- README.md +24 -10
- {ml-backend-with-image/app β app}/__init__.py +0 -0
- {ml-backend-with-image/app β app}/__pycache__/__init__.cpython-311.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/__init__.cpython-312.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/__init__.cpython-313.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/__init__.cpython-314.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/dataset.cpython-311.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/dataset.cpython-312.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/dataset.cpython-313.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/dataset.cpython-314.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/image_classifier.cpython-311.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/image_classifier.cpython-312.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/image_classifier.cpython-313.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/image_classifier.cpython-314.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/main.cpython-311.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/main.cpython-312.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/main.cpython-313.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/main.cpython-314.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/models.cpython-311.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/models.cpython-312.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/models.cpython-313.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/models.cpython-314.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/pipeline.cpython-311.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/pipeline.cpython-312.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/pipeline.cpython-313.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/pipeline.cpython-314.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/storage.cpython-311.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/storage.cpython-312.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/storage.cpython-313.pyc +0 -0
- {ml-backend-with-image/app β app}/__pycache__/storage.cpython-314.pyc +0 -0
- {ml-backend-with-image/app β app}/dataset.py +0 -0
- {ml-backend-with-image/app β app}/image_classifier.py +0 -0
- {ml-backend-with-image/app β app}/main.py +0 -0
- {ml-backend-with-image/app β app}/models.py +0 -0
- {ml-backend-with-image/app β app}/pipeline.py +0 -0
- {ml-backend-with-image/app β app}/storage.py +0 -0
- {ml-backend-with-image/data β data}/dataset.jsonl +0 -0
- ml-backend-with-image/debug_profanity.py β debug_profanity.py +0 -0
- ml-backend-with-image/.DS_Store +0 -0
- ml-backend-with-image/README.md +0 -24
- ml-backend-with-image/requirements.txt β requirements.txt +0 -0
- ml-backend-with-image/test_classification.py β test_classification.py +0 -0
- ml-backend-with-image/test_profanity.py β test_profanity.py +0 -0
ml-backend-with-image/Dockerfile β Dockerfile
RENAMED
|
File without changes
|
README.md
CHANGED
|
@@ -1,10 +1,24 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Civic ML Backend (Full: pHash + Location)
|
| 2 |
+
|
| 3 |
+
Overview:
|
| 4 |
+
|
| 5 |
+
- FastAPI backend that accepts citizen reports and performs:
|
| 6 |
+
- rule-based abuse detection
|
| 7 |
+
- text duplicate detection
|
| 8 |
+
- image duplicate detection using pHash (imagehash)
|
| 9 |
+
- location-based duplicate detection using Haversine formula
|
| 10 |
+
- image classification using CLIP (if available) with URL fallback
|
| 11 |
+
- priority detection (keyword-based)
|
| 12 |
+
|
| 13 |
+
Run:
|
| 14 |
+
|
| 15 |
+
1. python -m venv .venv
|
| 16 |
+
2. source .venv/bin/activate # Windows: .venv\Scripts\Activate
|
| 17 |
+
3. pip install -r requirements.txt
|
| 18 |
+
4. uvicorn app.main:app --reload --port 8000
|
| 19 |
+
|
| 20 |
+
Notes:
|
| 21 |
+
|
| 22 |
+
- The in-memory stores (seen_reports, seen_image_hashes, seen_locations) are ephemeral and reset on server restart.
|
| 23 |
+
- CLIP model download requires internet and may take time; if unavailable, the system uses URL keyword fallback for image labels.
|
| 24 |
+
- data/dataset.jsonl collects all incoming reports and results for later training/audit.
|
{ml-backend-with-image/app β app}/__init__.py
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/__init__.cpython-311.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/__init__.cpython-312.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/__init__.cpython-313.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/__init__.cpython-314.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/dataset.cpython-311.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/dataset.cpython-312.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/dataset.cpython-313.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/dataset.cpython-314.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/image_classifier.cpython-311.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/image_classifier.cpython-312.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/image_classifier.cpython-313.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/image_classifier.cpython-314.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/main.cpython-311.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/main.cpython-312.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/main.cpython-313.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/main.cpython-314.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/models.cpython-311.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/models.cpython-312.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/models.cpython-313.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/models.cpython-314.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/pipeline.cpython-311.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/pipeline.cpython-312.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/pipeline.cpython-313.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/pipeline.cpython-314.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/storage.cpython-311.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/storage.cpython-312.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/storage.cpython-313.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/__pycache__/storage.cpython-314.pyc
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/dataset.py
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/image_classifier.py
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/main.py
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/models.py
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/pipeline.py
RENAMED
|
File without changes
|
{ml-backend-with-image/app β app}/storage.py
RENAMED
|
File without changes
|
{ml-backend-with-image/data β data}/dataset.jsonl
RENAMED
|
File without changes
|
ml-backend-with-image/debug_profanity.py β debug_profanity.py
RENAMED
|
File without changes
|
ml-backend-with-image/.DS_Store
DELETED
|
Binary file (8.2 kB)
|
|
|
ml-backend-with-image/README.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
Civic ML Backend (Full: pHash + Location)
|
| 2 |
-
|
| 3 |
-
Overview:
|
| 4 |
-
|
| 5 |
-
- FastAPI backend that accepts citizen reports and performs:
|
| 6 |
-
- rule-based abuse detection
|
| 7 |
-
- text duplicate detection
|
| 8 |
-
- image duplicate detection using pHash (imagehash)
|
| 9 |
-
- location-based duplicate detection using Haversine formula
|
| 10 |
-
- image classification using CLIP (if available) with URL fallback
|
| 11 |
-
- priority detection (keyword-based)
|
| 12 |
-
|
| 13 |
-
Run:
|
| 14 |
-
|
| 15 |
-
1. python -m venv .venv
|
| 16 |
-
2. source .venv/bin/activate # Windows: .venv\Scripts\Activate
|
| 17 |
-
3. pip install -r requirements.txt
|
| 18 |
-
4. uvicorn app.main:app --reload --port 8000
|
| 19 |
-
|
| 20 |
-
Notes:
|
| 21 |
-
|
| 22 |
-
- The in-memory stores (seen_reports, seen_image_hashes, seen_locations) are ephemeral and reset on server restart.
|
| 23 |
-
- CLIP model download requires internet and may take time; if unavailable, the system uses URL keyword fallback for image labels.
|
| 24 |
-
- data/dataset.jsonl collects all incoming reports and results for later training/audit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ml-backend-with-image/requirements.txt β requirements.txt
RENAMED
|
File without changes
|
ml-backend-with-image/test_classification.py β test_classification.py
RENAMED
|
File without changes
|
ml-backend-with-image/test_profanity.py β test_profanity.py
RENAMED
|
File without changes
|