Giter VIP home page Giter VIP logo

tile-image-yolo's Introduction

Tile Image for YOLO Format

Problem

Sometimes small object in large resolution image need to be detected. If we try to labels the small object in a high resolution image and feed the data to the network with certain size (416x416 for example), then it will lose the detail of the small object because it is going to be compressed. As a result, the network cannot detect the object properly.

We can try to set the network input size based on the original image resolution, but most of the network architecture for object detection has constraint input size. The larger input size used in the network the larger memory in GPU will be used for training process. This is not very efficient for certain condition especially for those who has GPU memory limitation.

Tile image

This repo try to solve the problem by using image pre-processing technique called tile images. This such type of image processing can divide an image to several chunks images based on the grid size (3x3, 5x5, etc). The script also divide the label or the bounding box based on the corresponding divided images. So, make sure the image is already labelled/annotated (YOLO format).

image

Run Script

  1. Clone the repo and make sure you have opencv and python installed.
  2. Place your image and the label in data folder
  3. Open generate_data.py and change the IMAGE_DIR and LABEL_DIR according to yours
  4. Specify the grid size (3x3, 5x5, 7x7, ...)
  5. Run generate_data.py script (python3 generate_data.py)
  6. The image and the label will be generated and saved in generated folder

Current Limitation

  1. Tiling image and feed them to the network will produce model that can only recognize the divided image, not a whole image. So, in the future i want to make a script to automate tile and merge process during inference.
  2. Only single image can be feeded to the script. Soon, maybe the script can accept multiple images.

tile-image-yolo's People

Contributors

ismarapw avatar ismar-luckyx 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.