Spaces:
Sleeping
Sleeping
copilot-swe-agent[bot]
kr4phy
commited on
Commit
ยท
c15d55f
1
Parent(s):
4ae3a76
Update CLI and documentation for new methods
Browse filesCo-authored-by: kr4phy <168257476+kr4phy@users.noreply.github.com>
README.md
CHANGED
|
@@ -8,10 +8,12 @@ This project is a demo application that detects lane lines in videos using OpenC
|
|
| 8 |
|
| 9 |
## ๊ธฐ๋ฅ (Features)
|
| 10 |
- ๐ฅ Gradio๋ฅผ ํตํ ๋น๋์ค ์
๋ก๋ (Video upload via Gradio)
|
| 11 |
-
- ๐ฃ๏ธ
|
| 12 |
- ๐ ์๋ณธ/์ฒ๋ฆฌ ๋น๋์ค ์ฌ์ด๋๋ฐ์ด์ฌ์ด๋ ๋น๊ต (Side-by-side comparison of original and processed videos)
|
|
|
|
| 13 |
- ๐ป CLI ๋๊ตฌ ์ ๊ณต (Command-line interface available)
|
| 14 |
- ๐งช ํฌ๊ด์ ์ธ ํ
์คํธ ์ค์ํธ (Comprehensive test suite)
|
|
|
|
| 15 |
|
| 16 |
## ์ค์น (Installation)
|
| 17 |
|
|
@@ -47,7 +49,7 @@ python app.py
|
|
| 47 |
### ๋ฐฉ๋ฒ 2: CLI ์ฌ์ฉ (Using Command Line)
|
| 48 |
|
| 49 |
```bash
|
| 50 |
-
python cli.py input_video.mp4 output_video.mp4
|
| 51 |
```
|
| 52 |
|
| 53 |
์์ (Example):
|
|
@@ -55,32 +57,69 @@ python cli.py input_video.mp4 output_video.mp4
|
|
| 55 |
# ํ
์คํธ ๋น๋์ค ์์ฑ (Create test video)
|
| 56 |
python create_test_video.py
|
| 57 |
|
| 58 |
-
# ์ฐจ์ ๊ฐ์ง ์ฒ๋ฆฌ (Process with
|
| 59 |
-
python cli.py /tmp/test_road_video.mp4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
```
|
| 61 |
|
| 62 |
## ์ฐจ์ ๊ฐ์ง ์๊ณ ๋ฆฌ์ฆ (Lane Detection Algorithm)
|
| 63 |
|
| 64 |
-
๋ณธ ํ๋ก์ ํธ๋ ๋ค์๊ณผ ๊ฐ์
|
| 65 |
-
(This project
|
| 66 |
-
|
| 67 |
-
1. **
|
| 68 |
-
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
## ํ๋ก์ ํธ ๊ตฌ์กฐ (Project Structure)
|
| 86 |
|
|
|
|
| 8 |
|
| 9 |
## ๊ธฐ๋ฅ (Features)
|
| 10 |
- ๐ฅ Gradio๋ฅผ ํตํ ๋น๋์ค ์
๋ก๋ (Video upload via Gradio)
|
| 11 |
+
- ๐ฃ๏ธ 6๊ฐ์ง ์ฐจ์ ๊ฒ์ถ ๋ฐฉ๋ฒ ์ ๊ณต (6 lane detection methods available)
|
| 12 |
- ๐ ์๋ณธ/์ฒ๋ฆฌ ๋น๋์ค ์ฌ์ด๋๋ฐ์ด์ฌ์ด๋ ๋น๊ต (Side-by-side comparison of original and processed videos)
|
| 13 |
+
- ๐ ์ค์๊ฐ ์งํ ์ํฉ ํ์ (Real-time progress tracking with progress bar)
|
| 14 |
- ๐ป CLI ๋๊ตฌ ์ ๊ณต (Command-line interface available)
|
| 15 |
- ๐งช ํฌ๊ด์ ์ธ ํ
์คํธ ์ค์ํธ (Comprehensive test suite)
|
| 16 |
+
- โก GPU ๊ฐ์ ์ง์ (GPU acceleration support when available)
|
| 17 |
|
| 18 |
## ์ค์น (Installation)
|
| 19 |
|
|
|
|
| 49 |
### ๋ฐฉ๋ฒ 2: CLI ์ฌ์ฉ (Using Command Line)
|
| 50 |
|
| 51 |
```bash
|
| 52 |
+
python cli.py input_video.mp4 output_video.mp4 [method]
|
| 53 |
```
|
| 54 |
|
| 55 |
์์ (Example):
|
|
|
|
| 57 |
# ํ
์คํธ ๋น๋์ค ์์ฑ (Create test video)
|
| 58 |
python create_test_video.py
|
| 59 |
|
| 60 |
+
# ๋ค์ํ ๋ฐฉ๋ฒ์ผ๋ก ์ฐจ์ ๊ฐ์ง ์ฒ๋ฆฌ (Process with different methods)
|
| 61 |
+
python cli.py /tmp/test_road_video.mp4 result_advanced.mp4 advanced
|
| 62 |
+
python cli.py /tmp/test_road_video.mp4 result_yolop.mp4 yolop
|
| 63 |
+
python cli.py /tmp/test_road_video.mp4 result_ufld.mp4 ufld
|
| 64 |
+
python cli.py /tmp/test_road_video.mp4 result_scnn.mp4 scnn
|
| 65 |
+
python cli.py /tmp/test_road_video.mp4 result_basic.mp4 basic_standard
|
| 66 |
+
python cli.py /tmp/test_road_video.mp4 result_segmented.mp4 basic_segmented
|
| 67 |
```
|
| 68 |
|
| 69 |
## ์ฐจ์ ๊ฐ์ง ์๊ณ ๋ฆฌ์ฆ (Lane Detection Algorithm)
|
| 70 |
|
| 71 |
+
๋ณธ ํ๋ก์ ํธ๋ ๋ค์๊ณผ ๊ฐ์ 6๊ฐ์ง ์ฐจ์ ๊ฐ์ง ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค:
|
| 72 |
+
(This project provides 6 lane detection methods:)
|
| 73 |
+
|
| 74 |
+
### 1. **Basic Standard (Hough Transform)**
|
| 75 |
+
- Grayscale ๋ณํ ๋ฐ ๊ฐ์ฐ์์ ๋ธ๋ฌ
|
| 76 |
+
- Canny ์์ง ๊ฒ์ถ
|
| 77 |
+
- Hough ๋ณํ์ ํตํ ์ง์ ๊ฒ์ถ
|
| 78 |
+
- ๋จ์ผ ํ๊ท ํ๋ ์ฐจ์ ํ์
|
| 79 |
+
- **์ฅ์ **: ๊ฐ์ฅ ๋น ๋ฅธ ์ฒ๋ฆฌ ์๋
|
| 80 |
+
- **๋จ์ **: ๊ณก์ ๋๋ก์์ ์ ํ๋ ๋ฎ์
|
| 81 |
+
|
| 82 |
+
### 2. **Basic Segmented (Hough Transform)**
|
| 83 |
+
- Basic Standard์ ๋์ผํ ๊ธฐ๋ณธ ์ฒ๋ฆฌ
|
| 84 |
+
- ์ฌ๋ฌ ์ ๋ถ์ผ๋ก ์ฐจ์ ํํ
|
| 85 |
+
- **์ฅ์ **: ๊ณก์ ํํ ๊ฐ์ , ๋น ๋ฅธ ์ฒ๋ฆฌ
|
| 86 |
+
- **๋จ์ **: ๋ณต์กํ ์ฐจ์ ์์๋ ํ๊ณ
|
| 87 |
+
|
| 88 |
+
### 3. **Advanced (Perspective Transform + Polynomial)**
|
| 89 |
+
- ์๊ทผ ๋ณํ์ผ๋ก bird's eye view ์์ฑ
|
| 90 |
+
- CLAHE๋ฅผ ์ด์ฉํ ํฅ์๋ ๋๋น ๊ฐ์
|
| 91 |
+
- ์ฌ๋ผ์ด๋ฉ ์๋์ฐ๋ฅผ ํตํ ๋คํญ์ ํผํ
|
| 92 |
+
- ๊ทธ๋๋์ธํธ ๋ฐฉํฅ ํํฐ๋ง
|
| 93 |
+
- **์ฅ์ **: ๋์ ์ ํ๋, ๊ณก์ ๋ฐ ์ ์ ์ฐจ์ ์ฐ์
|
| 94 |
+
- **๋จ์ **: ์ฒ๋ฆฌ ์๋๊ฐ ๋๋ฆผ
|
| 95 |
+
|
| 96 |
+
### 4. **YOLOP (Multi-task Learning)**
|
| 97 |
+
- YOLOP (You Only Look Once for Panoptic Driving) ์๊ฐ
|
| 98 |
+
- ๋ค์ค ์์ ์ฐจ์ ๊ฒ์ถ (ํฐ์, ๋
ธ๋์)
|
| 99 |
+
- ์ปจํฌ์ด ๊ธฐ๋ฐ ์ธ๊ทธ๋ฉํ
์ด์
|
| 100 |
+
- **์ฅ์ **: ๋ค์ํ ์ฐจ์ ์์ ์ธ์, ๋น ๋ฅธ ์ฒ๋ฆฌ
|
| 101 |
+
- **๋จ์ **: ๋ณต์กํ ๋๋ก ํ๊ฒฝ์์ ์ ํ๋ ์ ํ
|
| 102 |
+
|
| 103 |
+
### 5. **UFLD (Ultra Fast Lane Detection)**
|
| 104 |
+
- Ultra Fast Structure-aware Deep Lane Detection ์๊ฐ
|
| 105 |
+
- ํ๋ณ ๋ถ๋ฅ ์ ๊ทผ ๋ฐฉ์
|
| 106 |
+
- ์ ์ํ ์๊ณ๊ฐ ์ฒ๋ฆฌ
|
| 107 |
+
- **์ฅ์ **: ์๋์ ์ ํ๋์ ๊ท ํ, ์ค์๊ฐ ๊ฐ๋ฅ
|
| 108 |
+
- **๋จ์ **: ๋งค์ฐ ๋ณต์กํ ํ๊ฒฝ์์๋ SCNN๋ณด๋ค ๋ฎ์ ์ ํ๋
|
| 109 |
+
|
| 110 |
+
### 6. **SCNN (Spatial CNN)**
|
| 111 |
+
- Spatial CNN for traffic lane detection ์๊ฐ
|
| 112 |
+
- 4๋ฐฉํฅ ๊ณต๊ฐ ๋ฉ์์ง ์ ๋ฌ
|
| 113 |
+
- ๋ค์ค ์ค์ผ์ผ ์์ง ๊ฒ์ถ
|
| 114 |
+
- **์ฅ์ **: ๋ณต์กํ ์๋๋ฆฌ์ค์์ ์ต๊ณ ์ ํ๋
|
| 115 |
+
- **๋จ์ **: ์ฒ๋ฆฌ ์๊ฐ์ด ๋ค์ ์์๋จ
|
| 116 |
+
|
| 117 |
+
### ์๊ณ ๋ฆฌ์ฆ ์ ํ ๊ฐ์ด๋ (Selection Guide)
|
| 118 |
+
- **์ต๊ณ ์๋**: Basic Standard, YOLOP
|
| 119 |
+
- **๊ณก์ ๋๋ก**: UFLD, Advanced, Basic Segmented
|
| 120 |
+
- **์ต๊ณ ์ ํ๋**: SCNN, Advanced (Enhanced)
|
| 121 |
+
- **๋ค์ํ ์ฐจ์ ์์**: YOLOP
|
| 122 |
+
- **๊ท ํ์กํ ์ฑ๋ฅ**: UFLD
|
| 123 |
|
| 124 |
## ํ๋ก์ ํธ ๊ตฌ์กฐ (Project Structure)
|
| 125 |
|
cli.py
CHANGED
|
@@ -14,13 +14,16 @@ def main():
|
|
| 14 |
print("\nArguments:")
|
| 15 |
print(" input_video: Path to input video file")
|
| 16 |
print(" output_video: Path to output video file")
|
| 17 |
-
print(" method: '
|
| 18 |
print(" enhanced: 'true' or 'false' for enhanced thresholding (default: true, advanced only)")
|
| 19 |
print(" segmented: 'true' or 'false' for segmented lines (default: false, basic only)")
|
| 20 |
print("\nExamples:")
|
| 21 |
print(" python cli.py road_video.mp4 output_result.mp4")
|
| 22 |
-
print(" python cli.py road_video.mp4 output_result.mp4
|
| 23 |
-
print(" python cli.py road_video.mp4 output_result.mp4
|
|
|
|
|
|
|
|
|
|
| 24 |
print(" python cli.py road_video.mp4 output_result.mp4 advanced true false")
|
| 25 |
sys.exit(1)
|
| 26 |
|
|
@@ -31,8 +34,9 @@ def main():
|
|
| 31 |
segmented = sys.argv[5].lower() == "true" if len(sys.argv) >= 6 else False
|
| 32 |
|
| 33 |
# Validate method
|
| 34 |
-
|
| 35 |
-
|
|
|
|
| 36 |
sys.exit(1)
|
| 37 |
|
| 38 |
# Check if input file exists
|
|
@@ -45,7 +49,7 @@ def main():
|
|
| 45 |
print(f"Method: {method}")
|
| 46 |
if method == "advanced":
|
| 47 |
print(f"Enhanced thresholding: {'enabled' if enhanced else 'disabled'}")
|
| 48 |
-
if method
|
| 49 |
print(f"Segmented lines: {'enabled' if segmented else 'disabled'}")
|
| 50 |
print("\nProcessing...")
|
| 51 |
|
|
|
|
| 14 |
print("\nArguments:")
|
| 15 |
print(" input_video: Path to input video file")
|
| 16 |
print(" output_video: Path to output video file")
|
| 17 |
+
print(" method: 'basic_standard', 'basic_segmented', 'advanced', 'yolop', 'ufld', or 'scnn' (default: advanced)")
|
| 18 |
print(" enhanced: 'true' or 'false' for enhanced thresholding (default: true, advanced only)")
|
| 19 |
print(" segmented: 'true' or 'false' for segmented lines (default: false, basic only)")
|
| 20 |
print("\nExamples:")
|
| 21 |
print(" python cli.py road_video.mp4 output_result.mp4")
|
| 22 |
+
print(" python cli.py road_video.mp4 output_result.mp4 yolop")
|
| 23 |
+
print(" python cli.py road_video.mp4 output_result.mp4 ufld")
|
| 24 |
+
print(" python cli.py road_video.mp4 output_result.mp4 scnn")
|
| 25 |
+
print(" python cli.py road_video.mp4 output_result.mp4 basic_standard")
|
| 26 |
+
print(" python cli.py road_video.mp4 output_result.mp4 basic_segmented")
|
| 27 |
print(" python cli.py road_video.mp4 output_result.mp4 advanced true false")
|
| 28 |
sys.exit(1)
|
| 29 |
|
|
|
|
| 34 |
segmented = sys.argv[5].lower() == "true" if len(sys.argv) >= 6 else False
|
| 35 |
|
| 36 |
# Validate method
|
| 37 |
+
valid_methods = ["basic_standard", "basic_segmented", "advanced", "yolop", "ufld", "scnn"]
|
| 38 |
+
if method not in valid_methods:
|
| 39 |
+
print(f"Error: Invalid method '{method}'. Use one of: {', '.join(valid_methods)}")
|
| 40 |
sys.exit(1)
|
| 41 |
|
| 42 |
# Check if input file exists
|
|
|
|
| 49 |
print(f"Method: {method}")
|
| 50 |
if method == "advanced":
|
| 51 |
print(f"Enhanced thresholding: {'enabled' if enhanced else 'disabled'}")
|
| 52 |
+
if method in ["basic_standard", "basic_segmented"]:
|
| 53 |
print(f"Segmented lines: {'enabled' if segmented else 'disabled'}")
|
| 54 |
print("\nProcessing...")
|
| 55 |
|