Spaces:
Sleeping
Sleeping
altawil
commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
| 2 |
title: Baseer Self-Driving API
|
| 3 |
emoji: 🚗
|
| 4 |
colorFrom: blue
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
app_port: 7860
|
| 8 |
-
pinned:
|
| 9 |
license: mit
|
| 10 |
-
short_description:
|
| 11 |
tags:
|
| 12 |
- computer-vision
|
| 13 |
- autonomous-driving
|
|
@@ -22,126 +22,137 @@ tags:
|
|
| 22 |
|
| 23 |
# 🚗 Baseer Self-Driving API
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
[](https://adam-it-baseer-server.hf.space) |
|
| 28 |
+
| **Model** | [](https://huggingface.co/Adam-IT/Interfuser-Baseer-v1) |
|
| 29 |
+
| **Frameworks** | [](https://fastapi.tiangolo.com/) [](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/Adam-IT/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/Adam-IT/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 |
|
| 74 |
+
## 🚀 How to Use
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
+
Interact with the API by making HTTP requests to its endpoints.
|
| 77 |
|
| 78 |
+
### 1. Start a New Session
|
| 79 |
+
This will initialize a new set of tracker and controller instances on the server.
|
| 80 |
```bash
|
| 81 |
curl -X POST "https://adam-it-baseer-server.hf.space/start_session"
|
| 82 |
```
|
| 83 |
|
| 84 |
+
Response: `{"session_id": "your-new-session-id"}`
|
| 85 |
+
|
| 86 |
+
### 2. Run a Simulation Step
|
| 87 |
+
|
| 88 |
+
Send the current camera view and vehicle measurements to be processed.
|
| 89 |
+
|
| 90 |
```bash
|
| 91 |
curl -X POST "https://adam-it-baseer-server.hf.space/run_step" \
|
| 92 |
-H "Content-Type: application/json" \
|
| 93 |
-d '{
|
| 94 |
+
"session_id": "your-new-session-id",
|
| 95 |
+
"image_b64": "your-base64-encoded-bgr-image-string",
|
| 96 |
"measurements": {
|
| 97 |
+
"pos_global": [105.0, -20.0],
|
| 98 |
+
"theta": 1.57,
|
| 99 |
+
"speed": 5.5,
|
| 100 |
+
"target_point": [10.0, 0.0]
|
| 101 |
}
|
| 102 |
}'
|
| 103 |
```
|
| 104 |
|
| 105 |
+
### 3. End the Session
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
+
This will clean up the session data from the server.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
+
```bash
|
| 110 |
+
curl -X POST "https://adam-it-baseer-server.hf.space/end_session?session_id=your-new-session-id"
|
| 111 |
+
```
|
| 112 |
|
| 113 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
+
## 📡 API Endpoints
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
+
| Endpoint | Method | Description |
|
| 118 |
+
|---|---|---|
|
| 119 |
+
| `/` | GET | Landing page with API status. |
|
| 120 |
+
| `/docs` | GET | Interactive API documentation (Swagger UI). |
|
| 121 |
+
| `/start_session` | POST | Initializes a new driving session. |
|
| 122 |
+
| `/run_step` | POST | Processes a single frame and returns control commands. |
|
| 123 |
+
| `/end_session` | POST | Terminates a specific session. |
|
| 124 |
+
| `/sessions` | GET | Lists all currently active sessions. |
|
| 125 |
|
| 126 |
+
---
|
| 127 |
|
| 128 |
+
## 🎯 Intended Use Cases & Limitations
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
+
### ✅ Optimal Use Cases
|
| 131 |
+
- Simulating driving in CARLA environments.
|
| 132 |
+
- Research in end-to-end autonomous driving.
|
| 133 |
+
- Testing perception and control modules in a closed-loop system.
|
| 134 |
+
- Real-time object detection and trajectory planning.
|
| 135 |
|
| 136 |
+
### ⚠️ Limitations
|
| 137 |
+
- **Simulation-Only:** Trained exclusively on CARLA data. Not suitable for real-world driving.
|
| 138 |
+
- **Vision-Based:** Relies on a single front-facing camera and has inherent blind spots.
|
| 139 |
+
- **No LiDAR:** Lacks the robustness of sensor fusion in adverse conditions.
|
| 140 |
|
| 141 |
+
---
|
| 142 |
|
| 143 |
+
## 🛠️ Development
|
| 144 |
|
| 145 |
+
This project is part of a graduation thesis in Artificial Intelligence.
|
| 146 |
+
- **Deep Learning:** PyTorch
|
| 147 |
+
- **API Server:** FastAPI
|
| 148 |
+
- **Image Processing:** OpenCV
|
| 149 |
+
- **Scientific Computing:** NumPy
|
| 150 |
|
| 151 |
+
## 📞 Contact
|
| 152 |
|
| 153 |
+
For inquiries or support, please use the **Community** tab in this Space or open an issue in the project's GitHub repository (if available).
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
---
|
| 156 |
|
| 157 |
+
**Developed by:** Adam-IT
|
| 158 |
+
**License:** MIT
|
|
|