DIVYANSHI SINGH commited on
Commit
c1f2fb8
Β·
1 Parent(s): 7890600

refactor: Implemented professional modular structure (apds package)

Browse files
README.md CHANGED
@@ -45,12 +45,24 @@ An AI-powered Road Damage Assessment system using YOLOv11s & SAHI to detect poth
45
  Ensure your `.pt` files are placed in the `models/` directory structure:
46
  - `models/crack_detector_v12/best.pt`
47
  - `models/pothole_v1/best.pt`
 
48
 
49
  5. **Run the App**:
50
  ```bash
51
  streamlit run app.py
52
  ```
53
 
 
 
 
 
 
 
 
 
 
 
 
54
  ## πŸ“Š Methodology
55
 
56
  This project utilizes **SAHI** to overcome the limitations of standard object detectors on small, narrow distresses like cracks. By tiling images during inference, we maintain resolution and capture the fine textures required for accurate road distress classification.
 
45
  Ensure your `.pt` files are placed in the `models/` directory structure:
46
  - `models/crack_detector_v12/best.pt`
47
  - `models/pothole_v1/best.pt`
48
+ - `models/pothole_v2/best.pt` (Experiment V2)
49
 
50
  5. **Run the App**:
51
  ```bash
52
  streamlit run app.py
53
  ```
54
 
55
+ ## πŸ“‚ Project Structure
56
+
57
+ Following high-level professional standards, this project is organized as a modular package:
58
+
59
+ - **`app.py`**: The main entry point for the Streamlit application.
60
+ - **`apds/`**: The core package containing the detection engine, geospatial logic, and AI consultant bridge.
61
+ - **`models/`**: Centralized storage for trained weights and performace validation artifacts.
62
+ - **`docs/`**: Indian Road Congress (IRC) engineering manuals used by the RAG system.
63
+ - **`tests/`**: Unit testing suite for core components.
64
+ - **`scripts/`**: Development and historical training scripts.
65
+
66
  ## πŸ“Š Methodology
67
 
68
  This project utilizes **SAHI** to overcome the limitations of standard object detectors on small, narrow distresses like cracks. By tiling images during inference, we maintain resolution and capture the fine textures required for accurate road distress classification.
apds/__init__.py ADDED
File without changes
dashboard.py β†’ apds/dashboard.py RENAMED
File without changes
detector.py β†’ apds/detector.py RENAMED
File without changes
gps.py β†’ apds/gps.py RENAMED
File without changes
path_utils.py β†’ apds/path_utils.py RENAMED
@@ -7,7 +7,7 @@ Centralised path handling for the Pothole Detection Streamlit app.
7
  from pathlib import Path
8
 
9
  # ── Root of the project ────────────────────────────────────────────────────────
10
- ROOT = Path(__file__).resolve().parent
11
 
12
  def get_available_models() -> dict:
13
  """
 
7
  from pathlib import Path
8
 
9
  # ── Root of the project ────────────────────────────────────────────────────────
10
+ ROOT = Path(__file__).resolve().parent.parent
11
 
12
  def get_available_models() -> dict:
13
  """
rag_utils.py β†’ apds/rag_utils.py RENAMED
@@ -14,8 +14,8 @@ from langchain.chains import RetrievalQA
14
 
15
  # ── Configuration ───────────────────────────────────────────────────────────
16
 
17
- DB_PATH = Path("models/vector_db")
18
- KNOWLEDGE_DIR = Path("Knowledge_base")
19
 
20
  @st.cache_resource
21
  def get_embeddings():
 
14
 
15
  # ── Configuration ───────────────────────────────────────────────────────────
16
 
17
+ DB_PATH = Path(__file__).resolve().parent.parent / "models" / "vector_db"
18
+ KNOWLEDGE_DIR = Path(__file__).resolve().parent.parent / "docs"
19
 
20
  @st.cache_resource
21
  def get_embeddings():
utils.py β†’ apds/utils.py RENAMED
File without changes
app.py CHANGED
@@ -117,5 +117,5 @@ st.markdown(
117
  )
118
 
119
  # ── Import and render dashboard ───────────────────────────────────────────────
120
- import dashboard
121
  dashboard.render()
 
117
  )
118
 
119
  # ── Import and render dashboard ───────────────────────────────────────────────
120
+ from apds import dashboard
121
  dashboard.render()
docs/irc.gov.in.082.2015.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eade6f369685e0419405d670d655664e375c8a53b069769abbe28e1188286971
3
+ size 988736
docs/irc.gov.in.sp.020.2002.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4da7e431470f4bc2efaa14ade72820ed026582e47f2502350ccec3dbf3d948f7
3
+ size 25510662
docs/mort.250.2013.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bc024a285250e171285f86870c0a04505f1e115a1c84b4a88892a6ffdc892e3
3
+ size 4243960
train_old.py β†’ scripts/train_old.py RENAMED
File without changes