1. 安裝 Python
- 前往 Python 官方網站,下載並安裝相容版本(如 3.9)。
安裝時務必勾選「Add Python to PATH」! - 安裝完成後,開啟命令提示字元(cmd)輸入
python --version驗證版本- 例外處理 – 若未顯示則手動編輯環境變數:搜尋 “環境變數”,在系統 PATH 新增 Python 安裝路徑(如 C:\Program File\Python39)和 Scripts 資料夾(如 C:\Program File\Python39\Scripts)。
- 再來更新pip,命令提示字元(cmd)輸入
python.exe -m pip install --upgrade pip - 最後來安裝python環境管理套件uv,命令提示字元(cmd)輸入 “pip install uv
,安裝完成後,關閉命令提示視窗
2. 建立虛擬環境
- 開啟命令提示字元(cmd),導航至專案資料夾(如C:\YOLOv5Project)
- 建立Python 3.9.11虛擬環境,在命令提示字元(cmd),輸入
uv venv --python 3.9.11- 例外處理 – 如果出現“‘uv’ 不是內部或外部命令、可執行的程式或批次檔。”,在 Windows 11 上使用 pip 安裝 uv 後,命令提示字元無法識別 “uv”,因為 pip 預設安裝到用戶目錄 (c:\users\使用者\appdata\roaming\python\python39\site-packages),而非系統 PATH 路徑,因此需手動將用戶 Scripts 資料夾加入環境變數。
- 啟用虛擬環境,在命令提示字元(cmd)輸入
.venv\Scripts\activate- 說明 – 正常開啟虛擬環境後,在命令提示視窗會出現”(YOLOv5Project) C:\YOLOv5Project>”
3. 安裝 PyTorch 與 CUDA 支援 (在虛擬環境下執行)
依電腦硬體來安裝適用的PyTorch,這個步驟要下載2G多的資料,整個過程約需 10-20 分鐘,視電腦與網路效能而定。
- 有GPU用這個指令⇒ uv pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 –index-url https://download.pytorch.org/whl/cu118
- 無GPU用這個指令⇒ uv pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2
4.下載並安裝 YOLOv5 (在虛擬環境下執行)
- 開啟命令提示字元(cmd),導航至專案資料夾(如C:\YOLOv5Project)
- 啟用虛擬環境,進行下載YOLOv5原始碼,在命令提示字元(cmd)輸入
git clone https://github.com/ultralytics/yolov5.git - 下載完整後,進入 yolov5 資料夾,安裝依賴套件,整個過程約需 10-20 分鐘,視電腦與網路效能而定。
- 安裝依賴套件(如 OpenCV、Matplotlib),在命令提示字元(cmd)輸入
uv pip install -r yolov5/requirements.txt
- 安裝依賴套件(如 OpenCV、Matplotlib),在命令提示字元(cmd)輸入
5. 安裝 Spyder IDE
- 開啟命令提示字元(cmd),導航至專案資料夾(如C:\YOLOv5Project)
- 啟用虛擬環境,下載YOLOv5原始碼,在命令提示字元(cmd)輸入
uv pip install spyder
6. 設定Spyder IDE
- 開啟命令提示字元(cmd):輸入
spyder - 前往Tools > Preferences > Python Interpreter
- 選擇"Use the following Python interpreter",瀏覽至虛擬環境的python.exe
- 以此專案來說會需要設定到:”C:\YOLOv5Project.venv\Scripts\python.exe”
- 套用並重啟Spyder,確認在IPython Console中輸入
import sys; print(sys.executable)顯示環境路徑是否設定一致。
7. 使用Spyder測試 YOLOv5功能
- 開啟命令提示字元(cmd):輸入
spyder - 在Spyder中,執行detect.py
- 無錯誤即安裝成功。
💡需安裝的windows軟體
💡需安裝的Python模組
- uv 套件管理程式
pip install uv
- Spyder IDE
uv pip install spyder
- PyTorch CUDA
uv pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
- YOLOv5 下載並安裝相關依賴
git clone https://github.com/ultralytics/yolov5.gituv pip install -r yolov5/requirements.txt
I learned a few tricks here that I’ll definitely use. Thanks!
Great post — I found the examples really helpful. Thanks for sharing!
Nice guide — the tips are simple but effective. Thanks!
This article is phenomenal! I’ve been struggling with this exact challenge, and your post gave me both the understanding and the tools I needed to move forward. I love how you broke down each step and explained not just what to do but why it works. The troubleshooting section was also incredibly helpful – it’s clear you understand the common pitfalls people encounter. This is going straight to the top of my reference materials!
I learned a few tricks here that I’ll definitely use. Thanks!
Such a clear explanation — I feel more confident tackling this now.
I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.
Thanks for the examples — they made the theory much easier to digest.
I just like the helpful information you provide in your articles
For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
I love the personal examples — they made the advice relatable.
I just like the helpful information you provide in your articles
Thanks for the practical tips — they made a real difference for me.
I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.
Useful tips and friendly tone — a winning combination. Thanks!
This was exactly what I was searching for. Thanks a lot!
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
This is my first time pay a quick visit at here and i am really happy to read everthing at one place
This was beautiful Admin. Thank you for your reflections.
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
I like the efforts you have put in this, regards for all the great content.
AI TOOLS
I like the efforts you have put in this, regards for all the great content.
Great post — concise, useful, and well-presented. Thank you!
I like the efforts you have put in this, regards for all the great content.
Really great read — I appreciate how clearly you explained the importance of local online presence for businesses today. It’s a topic many companies overlook, i find it very interesting and very important topic. can i ask you a question? also we are recently checking out this newbies in the webdesign industry., you can take a look . waiting to ask my question if allowed. Thank you
It’s true that design choices heavily influence how people use a platform.
I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.
I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
Bilgiler için teşekkür ederim işime son derece yaradı
Hocam Ellerinize Saglık Güzel Makale Olmuş Detaylı
Emeğinize sağlık, bilgilendirmeler için teşekkür ederim.
Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
hocam gayet açıklayıcı bir yazı olmuş elinize emeğinize sağlık.
helloI like your writing very so much proportion we keep up a correspondence extra approximately your post on AOL I need an expert in this space to unravel my problem May be that is you Taking a look forward to see you
I finished my iready diagnostic so fast using a hack that my teacher was shocked.
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
Nice post. I learn something totally new and challenging on websites
Sitenizi tesadüfen buldum ama bundan sonra sık sık ziyaret edeceğim kesin.
Gerçekten çok faydalı ve bilgilendirici bir içerik olmuş, emeğinize sağlık.
Nice post. I learn something totally new and challenging on websites
gerçekten çok yararlı bi konu teşekkürler
There is definately a lot to find out about this subject. I like all the points you made
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
Bu konu hakkında bilgi vermeniz çok güzel. Genellikle türkçe içerikler az oluyor fakat böyle güzel içerikler görmek ve okumak çok zevkli.
Good post! We will be linking to this particularly great post on our site. Keep up the great writing
Sitenizin tasarımı da içerikleriniz de harika, özellikle içerikleri adım adım görsellerle desteklemeniz çok başarılı emeğinize sağlık.
For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
websitem için çok işime yaradı teşekkür ederim
I appreciate you sharing this blog post. Thanks Again. Cool.
Good post! We will be linking to this particularly great post on our site. Keep up the great writing
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks!
Çok işime yaradı bende bunu nasıl yapacağımı araştırıyorum. Paylaşım için teşekkür ederim.
very informative articles or reviews at this time.
AI search results optimization
Your writing has a way of resonating with me on a deep level. I appreciate the honesty and authenticity you bring to every post. Thank you for sharing your journey with us.
What i dont understood is in reality how youre now not really a lot more smartlyfavored than you might be now Youre very intelligent You understand therefore significantly in terms of this topic produced me personally believe it from a lot of numerous angles Its like women and men are not interested except it is one thing to accomplish with Woman gaga Your own stuffs outstanding Always care for it up