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