1 Star 1 Fork 0

tkhe / yolov7

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install.md 2.13 KB
一键复制 编辑 原始数据 按行查看 历史
Your Name 提交于 2022-03-05 16:22 . update deps

YOLOv7 Install

Please install detectron2 first, this is the basic dependency. For detectron2 just clone official repo and install follow their instructions.

yolov7 is not a lib, it's a project ready for use. But to install dependencies, there still need some process.

First, please consider install 2 important lib that you might not familliar with:

alfred-py
nbnb

Both of them can be installed from pip. The first one provides enhanced and full-featured visualization utils for drawing boxes, masks etc. And it provides some very convenient tools for users to visialization your coco dataset (VOC, YOLO format also supported). After install, you can call alfred to get more details.

nbnb is a lib that provides some useful common network blocks.

Also, if you need fbnetv3, you need install mobilecv from FaceBook:

pip install git+https://github.com/facebookresearch/mobile-vision.git

After install, you can now ready to train with YOLOv7.

python train_net.py --config-file configs/coco/darknet53.yaml --num-gpus 8

train YOLOX:

python train_net.py --config-file configs/coco/yolox_s.yaml --num-gpus 8

Train on Custom dataset

If you want train on custom dataset, you just need convert your dataset to coco format. And that's all, that's all you need do.

Then you just need create a new folder of your dataset under configs, and set your data path in config, take VisDrone dataset as example:

DATASETS:
  TRAIN: ("visdrone_train",)
  TEST: ("visdrone_val",)

Then register your dataset in train_visdrone.py:

DATASET_ROOT = './datasets/visdrone'
ANN_ROOT = os.path.join(DATASET_ROOT, 'visdrone_coco_anno')
TRAIN_PATH = os.path.join(DATASET_ROOT, 'VisDrone2019-DET-train/images')
VAL_PATH = os.path.join(DATASET_ROOT, 'VisDrone2019-DET-val/images')
TRAIN_JSON = os.path.join(ANN_ROOT, 'VisDrone2019-DET_train_coco.json')
VAL_JSON = os.path.join(ANN_ROOT, 'VisDrone2019-DET_val_coco.json')

register_coco_instances("visdrone_train", {}, TRAIN_JSON, TRAIN_PATH)
register_coco_instances("visdrone_val", {}, VAL_JSON, VAL_PATH)

Here, you set your json path, your images path, then you are ready to go.

1
https://gitee.com/tkhe/yolov7.git
git@gitee.com:tkhe/yolov7.git
tkhe
yolov7
yolov7
main

搜索帮助