altawil commited on
Commit
d31cf46
ยท
verified ยท
1 Parent(s): c8ad974

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +99 -88
README.md CHANGED
@@ -2,12 +2,12 @@
2
  title: Baseer Self-Driving API
3
  emoji: ๐Ÿš—
4
  colorFrom: blue
5
- colorTo: green
6
  sdk: docker
7
  app_port: 7860
8
- pinned: false
9
  license: mit
10
- short_description: Self-driving API using InterFuser model
11
  tags:
12
  - computer-vision
13
  - autonomous-driving
@@ -22,126 +22,137 @@ tags:
22
 
23
  # ๐Ÿš— Baseer Self-Driving API
24
 
25
- [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Adam-IT/Baseer_Server)
26
- [![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=flat&logo=fastapi)](https://fastapi.tiangolo.com/)
27
- [![PyTorch](https://img.shields.io/badge/PyTorch-%23EE4C2C.svg?style=flat&logo=PyTorch&logoColor=white)](https://pytorch.org/)
 
 
28
 
29
- ## ๐Ÿ“‹ ูˆุตู ุงู„ู…ุดุฑูˆุน
30
 
31
- **Baseer** ู‡ูˆ ู†ุธุงู… ู‚ูŠุงุฏุฉ ุฐุงุชูŠุฉ ู…ุชู‚ุฏู… ูŠุณุชุฎุฏู… ู†ู…ูˆุฐุฌ **InterFuser** ุงู„ู…ุฏุฑุจ ุนู„ู‰ ุจูŠุงู†ุงุช ู…ุญุงูƒุงุฉ CARLA. ูŠูˆูุฑ ู‡ุฐุง ุงู„ู…ุดุฑูˆุน ูˆุงุฌู‡ุฉ ุจุฑู…ุฌุฉ ุชุทุจูŠู‚ุงุช (API) ู‚ูˆูŠุฉ ูˆู…ุณุชุถุงูุฉ ุนู„ู‰ Hugging Face Spaces ู„ู„ุชูุงุนู„ ู…ุน ู†ู…ูˆุฐุฌ ุงู„ู‚ูŠุงุฏุฉ ุงู„ุฐุงุชูŠุฉ.
32
 
33
- ## โœจ ุงู„ู…ูŠุฒุงุช ุงู„ุฑุฆูŠุณูŠุฉ
34
 
35
- ### ๐Ÿง  **ู†ู…ูˆุฐุฌ InterFuser ู…ุชู‚ุฏู…**
36
- - ู…ุฏุฑุจ ุนู„ู‰ ุจูŠุงู†ุงุช PDM_Lite_Carla
37
- - ูŠุฑูƒุฒ ุนู„ู‰ ุงูƒุชุดุงู ุงู„ูƒุงุฆู†ุงุช ุงู„ู…ุฑูˆุฑูŠุฉ (Traffic Detection)
38
- - ุฏู‚ุฉ ุนุงู„ูŠุฉ ููŠ ุชุญุฏูŠุฏ ุงู„ู…ุณุงุฑุงุช (Waypoint Prediction)
39
- - ุชุญู„ูŠู„ ู…ุชู‚ุฏู… ู„ู„ู…ุดู‡ุฏ ุงู„ุจุตุฑูŠ
 
 
 
 
 
 
 
 
 
 
 
40
 
41
- ### ๐Ÿ—๏ธ **ุจู†ูŠุฉ ุฎุงุฏู…-ุนู…ูŠู„**
42
- - **FastAPI** ู„ู„ุฃุฏุงุก ุงู„ุนุงู„ูŠ
43
- - ู…ุนุงู„ุฌุฉ ู…ุชูˆุงุฒูŠุฉ ู„ู„ุทู„ุจุงุช
44
- - ุฅุฏุงุฑุฉ ุฌู„ุณุงุช ู…ุชุนุฏุฏุฉ
45
- - ูˆุงุฌู‡ุฉ RESTful ุณู‡ู„ุฉ ุงู„ุงุณุชุฎุฏุงู…
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
- ### ๐Ÿ“Š **ู…ุฎุฑุฌุงุช ุดุงู…ู„ุฉ**
48
- - **ุฃูˆุงู…ุฑ ุงู„ุชุญูƒู…**: ุงู†ุนุทุงูุŒ ุชุณุงุฑุนุŒ ูุฑู…ู„ุฉ
49
- - **ุฎุฑูŠุทุฉ ุงู„ู…ุฑูˆุฑ**: ุงูƒุชุดุงู ุงู„ู…ุฑูƒุจุงุช ูˆุงู„ู…ุดุงุฉ
50
- - **ุชุญู„ูŠู„ ุงู„ู…ุดู‡ุฏ**: ุฅุดุงุฑุงุช ุงู„ู…ุฑูˆุฑุŒ ุนู„ุงู…ุงุช ุงู„ุชูˆู‚ูุŒ ุงู„ุชู‚ุงุทุนุงุช
51
- - **ู„ูˆุญุฉ ู…ุนู„ูˆู…ุงุช**: ุตูˆุฑุฉ ุชูุงุนู„ูŠุฉ ุดุงู…ู„ุฉ
52
 
53
- ## ๐Ÿš€ ูƒูŠููŠุฉ ุงู„ุงุณุชุฎุฏุงู…
54
 
55
- ### 1. ุจุฏุก ุฌู„ุณุฉ ุฌุฏูŠุฏุฉ
 
56
  ```bash
57
  curl -X POST "https://adam-it-baseer-server.hf.space/start_session"
58
  ```
59
 
60
- ### 2. ุฅุฑุณุงู„ ุฅุทุงุฑ ู„ู„ู…ุนุงู„ุฌุฉ
 
 
 
 
 
61
  ```bash
62
  curl -X POST "https://adam-it-baseer-server.hf.space/run_step" \
63
  -H "Content-Type: application/json" \
64
  -d '{
65
- "session_id": "your-session-id",
66
- "image_b64": "base64-encoded-image",
67
  "measurements": {
68
- "pos": [0.0, 0.0],
69
- "theta": 0.0,
70
- "speed": 0.0,
71
- "command": 4
72
  }
73
  }'
74
  ```
75
 
76
- ### 3. ุฅู†ู‡ุงุก ุงู„ุฌู„ุณุฉ
77
- ```bash
78
- curl -X POST "https://adam-it-baseer-server.hf.space/end_session?session_id=your-session-id"
79
- ```
80
-
81
- ## ๐Ÿ“ก ู†ู‚ุงุท ุงู„ู†ู‡ุงูŠุฉ (API Endpoints)
82
 
83
- | ุงู„ู†ู‚ุทุฉ | ุงู„ุทุฑูŠู‚ุฉ | ุงู„ูˆุตู |
84
- |--------|---------|--------|
85
- | `/` | GET | ู…ุนู„ูˆู…ุงุช ุงู„ู€ API |
86
- | `/start_session` | POST | ุจุฏุก ุฌู„ุณุฉ ุฌุฏูŠุฏุฉ |
87
- | `/run_step` | POST | ู…ุนุงู„ุฌุฉ ุฅุทุงุฑ ูˆุงุญุฏ |
88
- | `/end_session` | POST | ุฅู†ู‡ุงุก ุฌู„ุณุฉ |
89
- | `/sessions` | GET | ุนุฑุถ ุงู„ุฌู„ุณุงุช ุงู„ู†ุดุทุฉ |
90
- | `/docs` | GET | ุชูˆุซูŠู‚ ุชูุงุนู„ูŠ ู„ู„ู€ API |
91
 
92
- ## ๐Ÿ”ง ุงู„ู…ูˆุงุตูุงุช ุงู„ุชู‚ู†ูŠุฉ
 
 
93
 
94
- ### ุงู„ู†ู…ูˆุฐุฌ
95
- - **ุงู„ู†ูˆุน**: InterFuser (Fine-tuned)
96
- - **Backbone**: ResNet-50 ู„ู„ุตูˆุฑ
97
- - **ุงู„ุจุนุฏ ุงู„ู…ุฏู…ุฌ**: 256
98
- - **ุทุจู‚ุงุช ุงู„ู…ุญูˆู„**: 6 encoder + 6 decoder
99
- - **ุญุฌู… ุงู„ู†ู…ูˆุฐุฌ**: 545 MB
100
 
101
- ### ุงู„ู…ุฏุฎู„ุงุช
102
- - **ุงู„ุตูˆุฑ**: 224x224 RGB
103
- - **ุงู„ู‚ูŠุงุณุงุช**: ุงู„ู…ูˆู‚ุนุŒ ุงู„ุณุฑุนุฉุŒ ุงู„ุงุชุฌุงู‡
104
- - **ุงู„ุฃูˆุงู…ุฑ**: ุฃูˆุงู…ุฑ ุงู„ู‚ูŠุงุฏุฉ ุนุงู„ูŠุฉ ุงู„ู…ุณุชูˆู‰
105
 
106
- ### ุงู„ู…ุฎุฑุฌุงุช
107
- - **ุฃูˆุงู…ุฑ ุงู„ุชุญูƒู…**: steer, throttle, brake
108
- - **ุฎุฑูŠุทุฉ ุงู„ู…ุฑูˆุฑ**: ุดุจูƒุฉ 20x20 ู„ู„ูƒุงุฆู†ุงุช
109
- - **ุงู„ู…ุณุงุฑุงุช**: 10 ู†ู‚ุงุท ู…ุณุชู‚ุจู„ูŠุฉ
110
- - **ุชุญู„ูŠู„ ุงู„ู…ุดู‡ุฏ**: junction, traffic_light, stop_sign
 
 
 
111
 
112
- ## ๐ŸŽฏ ุญุงู„ุงุช ุงู„ุงุณุชุฎุฏุงู… ุงู„ู…ุซู„ู‰
113
 
114
- - โœ… **ุงู„ู‚ูŠุงุฏุฉ ููŠ ุงู„ุทุฑู‚ ุงู„ู…ุณุชู‚ูŠู…ุฉ**
115
- - โœ… **ุงูƒุชุดุงู ุงู„ู…ุฑูƒุจุงุช ูˆุงู„ู…ุดุงุฉ**
116
- - โœ… **ุชุฌู†ุจ ุงู„ุนูˆุงุฆู‚**
117
- - โœ… **ุงู„ุชู†ุจุค ุจุงู„ู…ุณุงุฑุงุช**
118
- - โœ… **ุชุญู„ูŠู„ ุงู„ู…ุดู‡ุฏ ุงู„ู…ุฑูˆุฑูŠ**
119
 
120
- ## โš ๏ธ ุงู„ู‚ูŠูˆุฏ
 
 
 
 
121
 
122
- - ู…ุญุฏูˆุฏ ุจูƒุงู…ูŠุฑุง ุฃู…ุงู…ูŠุฉ ูˆุงุญุฏุฉ
123
- - ู„ุง ูŠุณุชุฎุฏู… ุจูŠุงู†ุงุช LiDAR
124
- - ู…ูุญุณู† ู„ู„ุจูŠุฆุงุช ุงู„ู…ุญุงูƒุงุฉ (CARLA)
125
- - ู‚ุฏ ูŠุญุชุงุฌ ุชุนุฏูŠู„ ู„ู„ุจูŠุฆุงุช ุงู„ุญู‚ูŠู‚ูŠุฉ
126
 
127
- ## ๐Ÿ› ๏ธ ุงู„ุชุทูˆูŠุฑ ูˆุงู„ู…ุณุงู‡ู…ุฉ
128
 
129
- ู‡ุฐุง ุงู„ู…ุดุฑูˆุน ุฌุฒุก ู…ู† ู…ุดุฑูˆุน ุชุฎุฑุฌ ููŠ ู…ุฌุงู„ ุงู„ุฐูƒุงุก ุงู„ุงุตุทู†ุงุนูŠ ูˆุงู„ู‚ูŠุงุฏุฉ ุงู„ุฐุงุชูŠุฉ. ุชู… ุชุทูˆูŠุฑู‡ ุจุงุณุชุฎุฏุงู…:
130
 
131
- - **PyTorch** ู„ู„ุชุนู„ู… ุงู„ุนู…ูŠู‚
132
- - **FastAPI** ู„ูˆุงุฌู‡ุฉ ุงู„ุจุฑู…ุฌุฉ
133
- - **OpenCV** ู„ู…ุนุงู„ุฌุฉ ุงู„ุตูˆุฑ
134
- - **NumPy** ู„ู„ุญูˆุณุจุฉ ุงู„ุนู„ู…ูŠุฉ
 
135
 
136
- ## ๐Ÿ“ž ุงู„ุชูˆุงุตู„ ูˆุงู„ุฏุนู…
137
 
138
- ู„ู„ุงุณุชูุณุงุฑุงุช ูˆุงู„ุฏุนู… ุงู„ุชู‚ู†ูŠุŒ ูŠุฑุฌู‰ ุงุณุชุฎุฏุงู…:
139
- - **Issues** ููŠ ู…ุณุชูˆุฏุน GitHub
140
- - **Community** ููŠ Hugging Face
141
- - **Discussions** ููŠ ุตูุญุฉ Space
142
 
143
  ---
144
 
145
- **ุชู… ุชุทูˆูŠุฑู‡ ุจูˆุงุณุทุฉ**: Adam-IT
146
- **ุงู„ุชุฑุฎูŠุต**: MIT
147
- **ุงู„ู†ุณุฎุฉ**: 1.0.0
 
2
  title: Baseer Self-Driving API
3
  emoji: ๐Ÿš—
4
  colorFrom: blue
5
+ colorTo: red
6
  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
 
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%2Fadam-it-baseer-server.hf.space)](https://adam-it-baseer-server.hf.space) |
28
+ | **Model** | [![Model](https://img.shields.io/badge/Model-Interfuser--Baseer--v1-blue)](https://huggingface.co/Adam-IT/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/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