Giter VIP home page Giter VIP logo

small_object_detection's Introduction

Slice training method for YOLOv5

This repository is dedicated to the YOLOv5 model for small target detection. Its main objective is to improve the model's accuracy in detecting small objects by training it on sliced images.

demo

Dataset

This repository utilizes the VisDrone dataset (https://github.com/VisDrone/VisDrone-Dataset.git) for slice preprocessing and trains a YOLOv5 model with the sliced dataset.

The detection performance of the model is shown in the following images:

demo

How to run

1. Prepare the dataset according to the format in "EXAMPLE" under the link: https://roboflow.com/formats/yolov5-pytorch-txt?ref=ultralytics, and store the dataset images and labels in the images and labels folders respectively.

2. Modify the parameters in slice.py such as root, slice_width, slice_height, overlap_h_ratio, classes, etc., to suit your needs.

3. Run slice.py

Parameters

slice_width and slice_height: Represent the size of the slice boxes, overlap ratio is used to avoid the situation where bounding boxes are being devided.

overlap_h_ratio and overlap_w_ratio: Move a certain distance back in the original image's height and width directions respectively after each slicing, thereby preserve the training value of the segmented bounding boxes.

val: Used for validating the correctness of the slicing results. When set to True, it will visualize the bounding boxes of the first 'n' sliced images (where 'n' is a specified number).

classes: Target categories contained in the dataset.

Get the results

The results of the slicing are saved in the " ../runs/exp" directory.

The slice_images folder is used to store the sliced images.

The slice_labels folder is used to store the sliced labels.

The validate folder contains visualization images of the slicing effects.

small_object_detection's People

Contributors

fbh16 avatar

Stargazers

Vegicken Ye avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.