Skip to content

Commit

Permalink
feat: shifting to train yolo11 ✅
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusker233 committed Jan 15, 2025
1 parent d6e00d7 commit 1c5a78d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# 过滤非cat目标
cat_results = list(filter(lambda target: target["name"] == "cat", results))
# 跳过图片内检测不到cat或有多个cat的图片
if len(cat_results) != 1:
if len(cat_results) == 0:
num_skipped_photos += 1
continue
# 裁剪出cat
Expand Down
4 changes: 3 additions & 1 deletion data_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from sklearn.model_selection import train_test_split
import argparse
import json
import random
import shutil

parser = argparse.ArgumentParser(description="Cat Recognize Data Preprocessor")
parser.add_argument(
Expand Down Expand Up @@ -66,7 +68,7 @@ def resize_image(image_path, output_path, size):
]

# 如果图片数量不足 args.filter,则进行补充
if len(images) < args.filter:
if len(images) != 0 and len(images) < args.filter:
print(f"Category '{category}' has less than {args.filter} images. Augmenting...")
while len(images) < args.filter:
# 随机选择一张图片进行复制
Expand Down
Binary file added yolo11n.pt
Binary file not shown.

0 comments on commit 1c5a78d

Please sign in to comment.