copilot-swe-agent[bot]
Add Gradio UI with OpenCV lane detection implementation
2b342d6
|
raw
history blame
2.09 kB

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)

  1. ์ €์žฅ์†Œ ํด๋ก  (Clone the repository):
git clone https://github.com/kr4phy/OpenCVLaneDetectionDemo.git
cd OpenCVLaneDetectionDemo
  1. ํ•„์š”ํ•œ ํŒจํ‚ค์ง€ ์„ค์น˜ (Install required packages):
pip install -r requirements.txt

์‚ฌ์šฉ๋ฒ• (Usage)

  1. ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‹คํ–‰ (Run the application):
python app.py
  1. ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ž๋™์œผ๋กœ ์—ด๋ฆฌ๋Š” Gradio UI์— ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค. (The Gradio UI will automatically open in your browser)

  2. ๋น„๋””์˜ค ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•˜๊ณ  "Process Video" ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. (Upload a video file and click the "Process Video" button)

  3. ์ฒ˜๋ฆฌ๋œ ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค (์™ผ์ชฝ: ์›๋ณธ, ์˜ค๋ฅธ์ชฝ: ์ฐจ์„  ๊ฐ์ง€ ๊ฒฐ๊ณผ). (View the processed result - left: original, right: lane detection result)

์ฐจ์„  ๊ฐ์ง€ ์•Œ๊ณ ๋ฆฌ์ฆ˜ (Lane Detection Algorithm)

  1. Grayscale ๋ณ€ํ™˜ (Convert to grayscale)
  2. ๊ฐ€์šฐ์‹œ์•ˆ ๋ธ”๋Ÿฌ ์ ์šฉ (Apply Gaussian blur)
  3. Canny ์—์ง€ ๊ฒ€์ถœ (Canny edge detection)
  4. ๊ด€์‹ฌ ์˜์—ญ(ROI) ๋งˆ์Šคํ‚น (Apply region of interest mask)
  5. Hough ๋ณ€ํ™˜์œผ๋กœ ์ง์„  ๊ฒ€์ถœ (Detect lines using Hough transform)
  6. ์ฐจ์„  ํ‰๊ท ํ™” ๋ฐ ๊ทธ๋ฆฌ๊ธฐ (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