BaseerAI commited on
Commit
3e2aeec
Β·
verified Β·
1 Parent(s): c38083a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +78 -60
README.md CHANGED
@@ -7,67 +7,78 @@ sdk: docker
7
  app_port: 7860
8
  pinned: true
9
  license: mit
10
- short_description: A RESTful API for an InterFuser-based self-driving model.
11
  tags:
12
  - computer-vision
13
  - autonomous-driving
14
  - deep-learning
15
  - fastapi
16
  - pytorch
17
- - interfuser
18
- - graduation-project
19
  - carla
20
  - self-driving
 
 
 
21
  ---
22
 
23
- # πŸš— Baseer Self-Driving API
 
 
 
 
 
 
24
 
25
- | Service | Status |
26
- |---|---|
27
- | **API Status** | [![Status](https://img.shields.io/website?up_message=online&down_message=offline&url=https%3A%2F%2FBaseerAI-baseer-server.hf.space)](https://BaseerAI-baseer-server.hf.space) |
28
- | **Model** | [![Model](https://img.shields.io/badge/Model-Interfuser--Baseer--v1-blue)](https://huggingface.co/BaseerAI/Interfuser-Baseer-v1) |
29
- | **Frameworks** | [![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=flat&logo=fastapi)](https://fastapi.tiangolo.com/) [![PyTorch](https://img.shields.io/badge/PyTorch-%23EE4C2C.svg?style=flat&logo=PyTorch&logoColor=white)](https://pytorch.org/) |
30
 
31
- ## πŸ“‹ Project Description
32
 
33
- **Baseer** is an advanced self-driving system that provides a robust, real-time API for autonomous vehicle control. This Space hosts the FastAPI server that acts as an interface to the fine-tuned **[Interfuser-Baseer-v1](https://huggingface.co/BaseerAI/Interfuser-Baseer-v1)** model.
34
 
35
- The system is designed to take a live camera feed and vehicle measurements, process them through the deep learning model, and return actionable control commands and a comprehensive scene analysis.
36
 
37
  ---
38
 
39
- ## πŸ—οΈ Architecture
40
 
41
- This project follows a decoupled client-server architecture, where the model and the application are managed separately for better modularity and scalability.
42
 
43
  ```
44
- +-----------+ +------------------------+ +--------------------------+
45
- | | | | | |
46
- | Client | -> | Baseer API (Space) | -> | Interfuser Model (Hub) |
47
- |(e.g.CARLA)| | (FastAPI Server) | | (Private/Gated Weights) |
48
- | | | | | |
49
- +-----------+ +------------------------+ +--------------------------+
50
- HTTP Loads Model Model Repository
51
- Request
 
 
52
  ```
53
 
54
- ## ✨ Key Features
 
 
 
 
 
 
 
 
 
 
55
 
56
- ### 🧠 **Advanced Perception Engine**
57
- - **Powered by:** The [Interfuser-Baseer-v1](https://huggingface.co/BaseerAI/Interfuser-Baseer-v1) model.
58
- - **Focus:** High-accuracy traffic object detection and safe waypoint prediction.
59
- - **Scene Analysis:** Real-time assessment of junctions, traffic lights, and stop signs.
60
 
61
- ### ⚑ **High-Performance API**
62
- - **Framework:** Built with **FastAPI** for high throughput and low latency.
63
- - **Stateful Sessions:** Manages multiple, independent driving sessions, each with its own tracker and controller state.
64
- - **RESTful Interface:** Intuitive and easy-to-use API design.
65
 
66
- ### πŸ“Š **Comprehensive Outputs**
67
- - **Control Commands:** `steer`, `throttle`, `brake`.
68
- - **Scene Analysis:** Probabilities for junctions, traffic lights, and stop signs.
69
- - **Predicted Waypoints:** The model's intended path for the next 10 steps.
70
- - **Visual Dashboard:** A generated image that provides a complete, human-readable overview of the current state.
71
 
72
  ---
73
 
@@ -80,7 +91,7 @@ This will initialize a new set of tracker and controller instances on the server
80
 
81
  **Request:**
82
  ```bash
83
- curl -X POST "https://BaseerAI-baseer-server.hf.space/start_session"
84
  ```
85
 
86
  **Example Response:**
@@ -96,7 +107,7 @@ Send the current camera view and vehicle measurements to be processed. The API w
96
 
97
  **Request:**
98
  ```bash
99
- curl -X POST "https://BaseerAI-baseer-server.hf.space/run_step" \
100
  -H "Content-Type: application/json" \
101
  -d '{
102
  "session_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
@@ -136,7 +147,7 @@ curl -X POST "https://BaseerAI-baseer-server.hf.space/run_step" \
136
  [10.0, 0.10]
137
  ],
138
  "dashboard_b64": "a-very-long-base64-string-representing-the-dashboard-image...",
139
- "reason": "Red Light"
140
  }
141
  ```
142
 
@@ -145,7 +156,7 @@ curl -X POST "https://BaseerAI-baseer-server.hf.space/run_step" \
145
  - **`scene_analysis`**: Probabilities for different road hazards. A high `traffic_light_state` value (e.g., > 0.5) indicates a red light.
146
  - **`predicted_waypoints`**: The model's intended path, relative to the vehicle.
147
  - **`dashboard_b64`**: A Base64-encoded JPEG image of the full dashboard view, which can be directly displayed in a client application.
148
- - **`reason`**: A human-readable string explaining the primary reason for the control action (e.g., "Following ID 12", "Red Light", "Cruising").
149
 
150
  ### 3. End the Session
151
 
@@ -153,7 +164,7 @@ This will clean up the session data from the server.
153
 
154
  **Request:**
155
  ```bash
156
- curl -X POST "https://BaseerAI-baseer-server.hf.space/end_session?session_id=a1b2c3d4-e5f6-7890-1234-567890abcdef"
157
  ```
158
 
159
  **Example Response:**
@@ -180,32 +191,39 @@ curl -X POST "https://BaseerAI-baseer-server.hf.space/end_session?session_id=a1b
180
 
181
  ## 🎯 Intended Use Cases & Limitations
182
 
183
- ### βœ… Optimal Use Cases
184
- - Simulating driving in CARLA environments.
185
- - Research in end-to-end autonomous driving.
186
- - Testing perception and control modules in a closed-loop system.
187
- - Real-time object detection and trajectory planning.
188
 
189
- ### ⚠️ Limitations
190
- - **Simulation-Only:** Trained exclusively on CARLA data. Not suitable for real-world driving.
191
- - **Vision-Based:** Relies on a single front-facing camera and has inherent blind spots.
192
- - **No LiDAR:** Lacks the robustness of sensor fusion in adverse conditions.
193
 
194
  ---
195
 
196
- ## πŸ› οΈ Development
 
 
 
 
 
 
 
 
197
 
198
- This project is part of a graduation thesis in Artificial Intelligence.
199
- - **Deep Learning:** PyTorch
200
- - **API Server:** FastAPI
201
- - **Image Processing:** OpenCV
202
- - **Scientific Computing:** NumPy
203
 
204
- ## πŸ“ž Contact
205
 
206
- For inquiries or support, please use the **Community** tab in this Space or open an issue in the project's GitHub repository (if available).
207
 
208
  ---
209
 
210
- **Developed by:** Adam Altawil
211
- **License:** MIT
 
 
7
  app_port: 7860
8
  pinned: true
9
  license: mit
10
+ short_description: Hierarchical API for Interfuser-HDPE self-driving system.
11
  tags:
12
  - computer-vision
13
  - autonomous-driving
14
  - deep-learning
15
  - fastapi
16
  - pytorch
 
 
17
  - carla
18
  - self-driving
19
+ - graduation-project
20
+ - control-systems
21
+ - object-tracking
22
  ---
23
 
24
+ # πŸš— Baseer Self-Driving API: The Hierarchical Brain
25
+
26
+ **Service** | **Status**
27
+ :--- | :---
28
+ **API Status** | βœ… **Online & Ready**
29
+ **Perception Engine** | 🧠 **[Interfuser-HDPE Model](https://huggingface.co/BaseerAI/Interfuser-Baseer-v1)**
30
+ **Core Logic** | πŸš€ **FastAPI, Python**
31
 
32
+ ---
 
 
 
 
33
 
34
+ ## πŸ“‹ Project Overview
35
 
36
+ Welcome to the **Baseer Self-Driving API**, the real-time, stateful decision-making engine for our advanced autonomous driving system. This Space hosts a high-performance FastAPI server that encapsulates the complete "brain" of our agent, going far beyond simple model inference.
37
 
38
+ This API orchestrates the entire driving task: it takes raw sensor data from a simulator like CARLA, processes it through our foundational **Interfuser-HDPE** perception model, and then uses our custom-built **Temporal Tracker** and **Hierarchical Controller** to output intelligent, safe, and interpretable driving commands.
39
 
40
  ---
41
 
42
+ ## πŸ—οΈ System Architecture: Where Perception Meets Control
43
 
44
+ Our system demonstrates a clean separation between the core perception model and the decision-making logic, which is hosted entirely within this Space.
45
 
46
  ```
47
+ +-----------+ +------------------------------------+ +-------------------------+
48
+ | | | | | |
49
+ | Client | ----> | Baseer API (This Space) | ---> | Interfuser-HDPE Model |
50
+ |(e.g.CARLA)| | +--------------------------------+ | | (Perception Engine) |
51
+ | | HTTP | FastAPI Server | | | |
52
+ +-----------+ | | + Identity-Aware Tracker βœ… | | +-------------------------+
53
+ | | + Hierarchical Controller βœ… | |
54
+ | +--------------------------------+ |
55
+ | |
56
+ +--------------------------------------------+
57
  ```
58
 
59
+ The client sends sensor data, and this API orchestrates everything: it calls the perception model for analysis, then uses its internal stateful modules (Tracker and Controller) to make a final, context-aware decision.
60
+
61
+ ---
62
+
63
+ ## ✨ Key Features & Innovations
64
+
65
+ This API's intelligence comes from our custom-built downstream modules:
66
+
67
+ ### 🧠 **Intelligent Hierarchical Controller**
68
+ - **What it is:** A sophisticated decision-making module that operates on a clear hierarchy of rules: **`Safety First > Dynamic Obstacle Avoidance > Navigation`**.
69
+ - **Why it matters:** This structured approach ensures predictable, safe behavior and avoids the pitfalls of overly simplistic controllers. It produces actions that are aware of the full driving context.
70
 
71
+ ### πŸ’‘ **Cautious Memory for Occlusions**
72
+ - **What it is:** Our controller features a short-term "grace period" memory. If a lead vehicle is temporarily occluded (e.g., behind a truck), the system remains cautious instead of accelerating dangerously into the unknown.
73
+ - **Why it matters:** This elegantly solves the "deadly flutter" problem common in autonomous agents and drastically improves safety in dynamic traffic.
 
74
 
75
+ ### πŸ‘οΈ **Identity-Aware Temporal Tracking**
76
+ - **What it is:** A custom-built, object-oriented tracker that maintains a consistent ID for every vehicle in the scene.
77
+ - **Why it matters:** It provides the stable, long-term context needed for our controller to make informed decisions about following, yielding, or reacting to specific agents in the environment.
 
78
 
79
+ ### πŸ—£οΈ **Human-Readable Decisions**
80
+ - **What it is:** The API doesn't just return numbers; it returns a `reason` string (e.g., `"Following vehicle ID 15"`, `"Slowing for red light"`, `"Cautious: Lost track of lead vehicle"`).
81
+ - **Why it matters:** This provides unparalleled interpretability, making it easy to understand and debug the agent's behavior in real-time.
 
 
82
 
83
  ---
84
 
 
91
 
92
  **Request:**
93
  ```bash
94
+ curl -X POST "https://baseerai-baseer-server.hf.space/start_session"
95
  ```
96
 
97
  **Example Response:**
 
107
 
108
  **Request:**
109
  ```bash
110
+ curl -X POST "https://baseerai-baseer-server.hf.space/run_step" \
111
  -H "Content-Type: application/json" \
112
  -d '{
113
  "session_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
 
147
  [10.0, 0.10]
148
  ],
149
  "dashboard_b64": "a-very-long-base64-string-representing-the-dashboard-image...",
150
+ "reason": "Following vehicle ID 15"
151
  }
152
  ```
153
 
 
156
  - **`scene_analysis`**: Probabilities for different road hazards. A high `traffic_light_state` value (e.g., > 0.5) indicates a red light.
157
  - **`predicted_waypoints`**: The model's intended path, relative to the vehicle.
158
  - **`dashboard_b64`**: A Base64-encoded JPEG image of the full dashboard view, which can be directly displayed in a client application.
159
+ - **`reason`**: A human-readable string explaining the primary reason for the control action (e.g., "Following vehicle ID 15", "Slowing for red light", "Cautious: Lost track of lead vehicle").
160
 
161
  ### 3. End the Session
162
 
 
164
 
165
  **Request:**
166
  ```bash
167
+ curl -X POST "https://baseerai-baseer-server.hf.space/end_session?session_id=a1b2c3d4-e5f6-7890-1234-567890abcdef"
168
  ```
169
 
170
  **Example Response:**
 
191
 
192
  ## 🎯 Intended Use Cases & Limitations
193
 
194
+ βœ… **Optimal Use Cases**
195
+ - **Closed-loop simulation** and evaluation of full-stack driving agents in CARLA.
196
+ - **Researching the interplay between advanced perception and intelligent control.**
197
+ - **Rapid prototyping** of complex driving behaviors (like cautious following, yielding, etc.).
198
+ - Serving as a "smart agent" for creating dynamic traffic scenarios.
199
 
200
+ ⚠️ **Limitations**
201
+ - **Simulation-Only:** Designed for CARLA. Not for real-world vehicles.
202
+ - **Rule-Based High-Level Logic:** The controller's decision-making, while advanced, is based on a deterministic, hierarchical rule set, not end-to-end learning.
203
+ - **Vision-Based:** Inherits the limitations of its camera-only perception model in adverse weather or lighting.
204
 
205
  ---
206
 
207
+ ## πŸ› οΈ Development & Relation to Research
208
+
209
+ This API is the practical, deployed application of the research conducted for an Artificial Intelligence graduation thesis. It serves as the "brain" that utilizes the perception outputs from our foundational model.
210
+
211
+ - **Core Perception Model:** **[Interfuser-HDPE (Model Weights & Research)](https://huggingface.co/BaseerAI/Interfuser-Baseer-v1)**
212
+ - **Core Logic:** The Tracker and Controller modules are custom Python implementations hosted in this Space.
213
+ - **API Framework:** FastAPI
214
+
215
+ ## πŸ‘¨β€πŸ’» Development
216
 
217
+ - **Lead Researcher:** Adam Altawil
218
+ - **Project Type:** Graduation Project - AI & Autonomous Driving
219
+ - **Contact:** [Your Contact Information]
 
 
220
 
221
+ ## πŸ“„ License
222
 
223
+ This project is licensed under the MIT License.
224
 
225
  ---
226
 
227
+ <div align="center">
228
+ <strong>πŸš— Driving the Future with Hierarchical Intelligence πŸš—</strong>
229
+ </div>