Skip to content

Commit

Permalink
feat: shifting to yolo11
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusker233 committed Jan 14, 2025
1 parent e7286d1 commit 43878cc
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[http]
sslVerify = false
postBuffer = 1048576000
[url "https://gitclone.com/"]
insteadOf = https://
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ config.ts
.ipynb_checkpoints/
env
.vscode
.gitconfig
30 changes: 15 additions & 15 deletions data/config.demo.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
export const config = {
// laf云后台的appid
LAF_APPID: "your_laf_appid",
// 云函数getTempCOS调用得到
// 如果报错403,需要加laf环境变量,DEV_IPS="xxx.xxx.xxx.xxx",其中xxx为调用本段代码的机器公网ip
COS_KEY: {
"ExpiredTime": 1687775333,
"Expiration": "2023-06-26T10:28:53Z",
"Credentials": {
"Token": "your_token",
"TmpSecretId": "your_secret_id",
"TmpSecretKey": "your_secret_key"
},
"RequestId": "0c56a822-7d46-4256-8446-8c038ac32ce6"
}
}
// laf云后台的appid
LAF_APPID: "your_laf_appid",
// 云函数getTempCOS调用得到
// 如果报错403,需要加laf环境变量,DEV_IPS="xxx.xxx.xxx.xxx",其中xxx为调用本段代码的机器公网ip
COS_KEY: {
"ExpiredTime": 1687775333,
"Expiration": "2023-06-26T10:28:53Z",
"Credentials": {
"Token": "your_token",
"TmpSecretId": "your_secret_id",
"TmpSecretKey": "your_secret_key"
},
"RequestId": "0c56a822-7d46-4256-8446-8c038ac32ce6"
}
}
6 changes: 4 additions & 2 deletions data_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import torch
from tqdm import tqdm
from PIL import Image
from ultralytics import YOLO

SRC = "data/photos"
DEST = "data/crop_photos"

if __name__ == "__main__":
print("loading YOLOv5 model...")
model = torch.hub.load("yolov5", "custom", "yolov5/yolov5m.pt", source="local")
print("loading YOLO11 model...")
model = YOLO("yolo11m-cls.pt")
# model = torch.hub.load("yolov5", "custom", "yolov5/yolov5m.pt", source="local")

num_photos = 0
num_skipped_photos = 0
Expand Down
1 change: 1 addition & 0 deletions install_nodejs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ echo 'export PATH=$NODE_HOME/bin:$PATH' | tee -a /etc/profile
source /etc/profile
node -v
npm -v
npm config set registry https://registry.npmmirror.com
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def main():
)
args = parser.parse_args()

model = YOLO("yolov8m-cls.pt")
model = YOLO("yolo11m-cls.pt")
export_dir = "./export"

results = model.train(data=f"{args.data}", epochs=args.epoch, imgsz=args.size)
Expand Down
Binary file added yolo11m-cls.pt
Binary file not shown.

0 comments on commit 43878cc

Please sign in to comment.