Skip to content

Commit

Permalink
update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
WZMIAOMIAO committed Oct 28, 2020
1 parent 1bed342 commit e4dd9c7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pytorch_object_detection/yolov3_spp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
│ ├── img_utils.py: 部分图像处理方法
│ ├── layers.py: 实现的一些基础层结构
│ ├── parse_config.py: 解析yolov3-spp.cfg文件
│ ├── torch.utils.py: 使用pytorch实现的一些工具
│ ├── torch_utils.py: 使用pytorch实现的一些工具
│ └── utils.py: 训练网络过程中使用到的一些方法
├── train_utils: 训练验证网络时使用到的工具(包括多GPU训练以及使用cocotools)
Expand All @@ -49,7 +49,7 @@
│ ├── train 训练集目录
│ │ ├── images 训练集图像目录
│ │ └── labels 训练集标签目录
│ └── eval 验证集目录
│ └── val 验证集目录
│ ├── images 验证集图像目录
│ └── labels 验证集标签目录
```
Expand Down
4 changes: 2 additions & 2 deletions pytorch_object_detection/yolov3_spp/calculate_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"""
import os

train_annotation_dir = "/home/wz/my_project/my_yolo_dataset/train/labels"
val_annotation_dir = "/home/wz/my_project/my_yolo_dataset/val/labels"
train_annotation_dir = "./my_yolo_dataset/train/labels"
val_annotation_dir = "./my_yolo_dataset/val/labels"
classes_label = "./data/my_data_label.names"
cfg_path = "./cfg/yolov3-spp.cfg"

Expand Down
2 changes: 1 addition & 1 deletion pytorch_object_detection/yolov3_spp/predict_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def main():
t2 = torch_utils.time_synchronized()
print(t2 - t1)

pred = utils.non_max_suppression(pred, conf_thres=0.3, iou_thres=0.6, multi_label=True)[0]
pred = utils.non_max_suppression(pred, conf_thres=0.1, iou_thres=0.6, multi_label=True)[0]
t3 = time.time()
print(t3 - t2)

Expand Down
2 changes: 1 addition & 1 deletion pytorch_object_detection/yolov3_spp/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def train(hyp):

start_epoch = 0
best_map = 0.0
if weights.endswith(".pt"):
if weights.endswith(".pt") or weights.endswith(".pth"):
ckpt = torch.load(weights, map_location=device)

# load model
Expand Down
7 changes: 4 additions & 3 deletions pytorch_object_detection/yolov3_spp/trans_voc2yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
val_txt = "val.txt"

# 转换后的文件保存目录
save_file_root = "/home/wz/my_project/my_yolo_dataset"
save_file_root = "./my_yolo_dataset"

# label标签对应json文件
label_json_path = './data/pascal_voc_classes.json'
Expand All @@ -35,8 +35,9 @@
assert os.path.exists(voc_xml_path), "VOC xml path not exist..."
assert os.path.exists(train_txt_path), "VOC train txt file not exist..."
assert os.path.exists(val_txt_path), "VOC val txt file not exist..."
assert os.path.exists(save_file_root), "path saving yolo annotation not exist..."
assert os.path.exists(label_json_path), "label_json_path does not exist..."
if os.path.exists(save_file_root) is False:
os.makedirs(save_file_root)


def parse_xml_to_dict(xml):
Expand Down Expand Up @@ -128,7 +129,7 @@ def translate_info(file_names: list, save_root: str, class_dict: dict, train_val
f.write("\n" + " ".join(info))

# copy image into save_images_path
shutil.copyfile(img_path, os.path.join(save_images_path, img_path.split("/")[-1]))
shutil.copyfile(img_path, os.path.join(save_images_path, img_path.split(os.sep)[-1]))


def create_class_names(class_dict: dict):
Expand Down

0 comments on commit e4dd9c7

Please sign in to comment.