Skip to content

akashAD98/yolov7-pip-1

 
 

Repository files navigation

Yolov7-Pip: Packaged version of the Yolov7 repository

teaser

Overview

This repo is a packaged version of the Yolov7 model.

Installation

pip install yolov7_easy

Yolov7 Inference

import yolov7

# load pretrained or custom model
model = yolov7.load('yolov7.pt')

# set model parameters
model.conf = 0.25  # NMS confidence threshold
model.iou = 0.45  # NMS IoU threshold
model.classes = None  # (optional list) filter by class

# set image
imgs = 'inference/images'

# perform inference
results = model(imgs)

# inference with larger input size and test time augmentation
results = model(img, size=1280, augment=True)

# parse results
predictions = results.pred[0]
boxes = predictions[:, :4] # x1, y1, x2, y2
scores = predictions[:, 4]
categories = predictions[:, 5]

# show detection bounding boxes on image
results.show()

Citation

@article{wang2022yolov7,
  title={{YOLOv7}: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors},
  author={Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},
  journal={arXiv preprint arXiv:2207.02696},
  year={2022}
}

Acknowledgement

A part of the code is borrowed from Yolov5-pip. Many thanks for their wonderful works.

About

This repo is a packaged version of the Yolov7 model.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.3%
  • Other 0.7%