Spaces:
Sleeping
OpenCVLaneDetectionDemo
OpenCV Lane Detection Demo with Gradio
๊ฐ์ (Overview)
์ด ํ๋ก์ ํธ๋ OpenCV๋ฅผ ์ฌ์ฉํ์ฌ ๋น๋์ค์์ ์ฐจ์ ์ ๊ฐ์งํ๊ณ , Gradio UI๋ฅผ ํตํด ๊ฒฐ๊ณผ๋ฅผ ์๊ฐํํ๋ ๋ฐ๋ชจ ์ ํ๋ฆฌ์ผ์ด์ ์ ๋๋ค.
This project is a demo application that detects lane lines in videos using OpenCV and visualizes the results through a Gradio UI.
๊ธฐ๋ฅ (Features)
- ๐ฅ Gradio๋ฅผ ํตํ ๋น๋์ค ์ ๋ก๋ (Video upload via Gradio)
- ๐ฃ๏ธ OpenCV๋ฅผ ์ด์ฉํ ์ค์๊ฐ ์ฐจ์ ๊ฒ์ถ (Real-time lane detection using OpenCV)
- ๐ ์๋ณธ/์ฒ๋ฆฌ ๋น๋์ค ์ฌ์ด๋๋ฐ์ด์ฌ์ด๋ ๋น๊ต (Side-by-side comparison of original and processed videos)
์ค์น (Installation)
- ์ ์ฅ์ ํด๋ก (Clone the repository):
git clone https://github.com/kr4phy/OpenCVLaneDetectionDemo.git
cd OpenCVLaneDetectionDemo
- ํ์ํ ํจํค์ง ์ค์น (Install required packages):
pip install -r requirements.txt
์ฌ์ฉ๋ฒ (Usage)
- ์ ํ๋ฆฌ์ผ์ด์ ์คํ (Run the application):
python app.py
๋ธ๋ผ์ฐ์ ์์ ์๋์ผ๋ก ์ด๋ฆฌ๋ Gradio UI์ ์ ์ํฉ๋๋ค. (The Gradio UI will automatically open in your browser)
๋น๋์ค ํ์ผ์ ์ ๋ก๋ํ๊ณ "Process Video" ๋ฒํผ์ ํด๋ฆญํฉ๋๋ค. (Upload a video file and click the "Process Video" button)
์ฒ๋ฆฌ๋ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํฉ๋๋ค (์ผ์ชฝ: ์๋ณธ, ์ค๋ฅธ์ชฝ: ์ฐจ์ ๊ฐ์ง ๊ฒฐ๊ณผ). (View the processed result - left: original, right: lane detection result)
์ฐจ์ ๊ฐ์ง ์๊ณ ๋ฆฌ์ฆ (Lane Detection Algorithm)
- Grayscale ๋ณํ (Convert to grayscale)
- ๊ฐ์ฐ์์ ๋ธ๋ฌ ์ ์ฉ (Apply Gaussian blur)
- Canny ์์ง ๊ฒ์ถ (Canny edge detection)
- ๊ด์ฌ ์์ญ(ROI) ๋ง์คํน (Apply region of interest mask)
- Hough ๋ณํ์ผ๋ก ์ง์ ๊ฒ์ถ (Detect lines using Hough transform)
- ์ฐจ์ ํ๊ท ํ ๋ฐ ๊ทธ๋ฆฌ๊ธฐ (Average and draw lane lines)
์๊ตฌ์ฌํญ (Requirements)
- Python 3.7+
- gradio==4.44.0
- opencv-python==4.10.0.84
- numpy==1.26.4
๋ผ์ด์ ์ค (License)
MIT License