Mohan Rao Boddu commited on
Commit
4a87503
Β·
1 Parent(s): 1daba48

Fix HuggingFace folder structure

Browse files
Files changed (44) hide show
  1. ml-backend-with-image/Dockerfile β†’ Dockerfile +0 -0
  2. README.md +24 -10
  3. {ml-backend-with-image/app β†’ app}/__init__.py +0 -0
  4. {ml-backend-with-image/app β†’ app}/__pycache__/__init__.cpython-311.pyc +0 -0
  5. {ml-backend-with-image/app β†’ app}/__pycache__/__init__.cpython-312.pyc +0 -0
  6. {ml-backend-with-image/app β†’ app}/__pycache__/__init__.cpython-313.pyc +0 -0
  7. {ml-backend-with-image/app β†’ app}/__pycache__/__init__.cpython-314.pyc +0 -0
  8. {ml-backend-with-image/app β†’ app}/__pycache__/dataset.cpython-311.pyc +0 -0
  9. {ml-backend-with-image/app β†’ app}/__pycache__/dataset.cpython-312.pyc +0 -0
  10. {ml-backend-with-image/app β†’ app}/__pycache__/dataset.cpython-313.pyc +0 -0
  11. {ml-backend-with-image/app β†’ app}/__pycache__/dataset.cpython-314.pyc +0 -0
  12. {ml-backend-with-image/app β†’ app}/__pycache__/image_classifier.cpython-311.pyc +0 -0
  13. {ml-backend-with-image/app β†’ app}/__pycache__/image_classifier.cpython-312.pyc +0 -0
  14. {ml-backend-with-image/app β†’ app}/__pycache__/image_classifier.cpython-313.pyc +0 -0
  15. {ml-backend-with-image/app β†’ app}/__pycache__/image_classifier.cpython-314.pyc +0 -0
  16. {ml-backend-with-image/app β†’ app}/__pycache__/main.cpython-311.pyc +0 -0
  17. {ml-backend-with-image/app β†’ app}/__pycache__/main.cpython-312.pyc +0 -0
  18. {ml-backend-with-image/app β†’ app}/__pycache__/main.cpython-313.pyc +0 -0
  19. {ml-backend-with-image/app β†’ app}/__pycache__/main.cpython-314.pyc +0 -0
  20. {ml-backend-with-image/app β†’ app}/__pycache__/models.cpython-311.pyc +0 -0
  21. {ml-backend-with-image/app β†’ app}/__pycache__/models.cpython-312.pyc +0 -0
  22. {ml-backend-with-image/app β†’ app}/__pycache__/models.cpython-313.pyc +0 -0
  23. {ml-backend-with-image/app β†’ app}/__pycache__/models.cpython-314.pyc +0 -0
  24. {ml-backend-with-image/app β†’ app}/__pycache__/pipeline.cpython-311.pyc +0 -0
  25. {ml-backend-with-image/app β†’ app}/__pycache__/pipeline.cpython-312.pyc +0 -0
  26. {ml-backend-with-image/app β†’ app}/__pycache__/pipeline.cpython-313.pyc +0 -0
  27. {ml-backend-with-image/app β†’ app}/__pycache__/pipeline.cpython-314.pyc +0 -0
  28. {ml-backend-with-image/app β†’ app}/__pycache__/storage.cpython-311.pyc +0 -0
  29. {ml-backend-with-image/app β†’ app}/__pycache__/storage.cpython-312.pyc +0 -0
  30. {ml-backend-with-image/app β†’ app}/__pycache__/storage.cpython-313.pyc +0 -0
  31. {ml-backend-with-image/app β†’ app}/__pycache__/storage.cpython-314.pyc +0 -0
  32. {ml-backend-with-image/app β†’ app}/dataset.py +0 -0
  33. {ml-backend-with-image/app β†’ app}/image_classifier.py +0 -0
  34. {ml-backend-with-image/app β†’ app}/main.py +0 -0
  35. {ml-backend-with-image/app β†’ app}/models.py +0 -0
  36. {ml-backend-with-image/app β†’ app}/pipeline.py +0 -0
  37. {ml-backend-with-image/app β†’ app}/storage.py +0 -0
  38. {ml-backend-with-image/data β†’ data}/dataset.jsonl +0 -0
  39. ml-backend-with-image/debug_profanity.py β†’ debug_profanity.py +0 -0
  40. ml-backend-with-image/.DS_Store +0 -0
  41. ml-backend-with-image/README.md +0 -24
  42. ml-backend-with-image/requirements.txt β†’ requirements.txt +0 -0
  43. ml-backend-with-image/test_classification.py β†’ test_classification.py +0 -0
  44. 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
- title: Civicconnect
3
- emoji: πŸ”₯
4
- colorFrom: purple
5
- colorTo: green
6
- sdk: docker
7
- pinned: false
8
- ---
9
-
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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