BboxToolkit is a tiny library of special bounding boxes.

Overview

BboxToolkit

BboxToolkit is a light codebase collecting some practical functions for the special-shape detection, such as oriented detection. The whole project is written by python, which can run in different platform without compliation. We use this project to support the oriented detection benchmark OBBDetection.

news: We are now developing the BboxToolkit v2.0 intended to support the new OBBDetection based on MMdetection v2.10.

Main Features

  • Various type of Bboxes

    We define three different type of bounding boxes in BboxToolkit. They are horizontal bounding boxes (HBB), oriented bounding boxes (OBB), and 4 point polygon (POLY). Each type of boxes can convert to others easily.

  • Convinence for usage

    The functions in BboxToolkit will decide the box type according to the input shape. There is no need to concern about the input box type, when use BboxToolkit.

License

This project is released under the Apache 2.0 license

Installation

BboxToolkit requires following dependencies:

  • Python > 3
  • Numpy
  • Opencv-python
  • Shapely
  • Terminaltables
  • Pillow

BboxToolkit will automatically install dependencies when you install, so this section is mostly for your reference.

git clone https://github.com/jbwang1997/BboxToolkit
cd BboxToolkit
pip install -v -e . # or "python setup.py develop"

Usage

Please reference USAGE.md for detail.

Ackownledgement

BboxToolkit refers to DOTA_devkit, MMCV, and MMDetection. DOTA_devkit is the toolbox for DOTA Dataset MMCV is a foundational python library for computer vision. MMDetection is an open source object detection toolbox based on PyTorch.

Comments
  • TypeError: can't pickle _thread.RLock objects

    TypeError: can't pickle _thread.RLock objects

    Hi: when we use your tool img_split.py, meet the error TypeError: can't pickle _thread.RLock objects, happens " patch_infos = pool.map(worker, zip(infos, img_dirs))" , looks like multiprocessing problem , can you suggest us how to solve the problem, thanks

    opened by kelek2 5
  • DecompressionBombError when using img_split.py

    DecompressionBombError when using img_split.py

    When use img_split.py with my own dataset, I get error as below. After add Image.MAX_IMAGE_PIXELS = None to DOTAio.py, the error has gone. Do you think is there any cons when adding this line?

    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "BboxToolkit/tools/img_split.py", line 316, in <module>
        main()
      File "BboxToolkit/tools/img_split.py", line 268, in main
        nproc=args.nproc)
      File "/obbdetection/BboxToolkit/BboxToolkit/datasets/DOTAio.py", line 34, in load_dota
        contents = pool.map(_load_func, os.listdir(img_dir))
      File "/opt/conda/lib/python3.7/multiprocessing/pool.py", line 268, in map
        return self._map_async(func, iterable, mapstar, chunksize).get()
      File "/opt/conda/lib/python3.7/multiprocessing/pool.py", line 657, in get
        raise self._value
    PIL.Image.DecompressionBombError: Image size (625847040 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.
    
    opened by vpeopleonatank 4
  • create img_split_dota.py file for dota dataset

    create img_split_dota.py file for dota dataset

    I want to generate annotation .txt for splitted image. but, img_split.py create just .pkl files.

    So, I create new file img_split_dota.py file. It can make the annotation .txt file for spllitted image.

    Please review this PR.

    opened by ziippy 0
  • img_split_dota.py function merging to img_split.py

    img_split_dota.py function merging to img_split.py

    Considering your feedback, I try to merging the function from img_split_dota.py to img_split.py.

    To use classname in img_split.py, I did modify the BboxToolkit/datasets/DOTAio.py

    please review.

    opened by ziippy 0
  • dior-r visualization

    dior-r visualization

    This is my configuration file when I visualized Dior-R , { "load_type": "pkl", "img_dir": "/data/dataset/DIOR/JPEGImages-test", "ann_dir": "/data1/bk/6742.pkl", "classes": "dior", "prior_annfile": null, "merge_type": "addition", "load_nproc": 10,

    "skip_empty": false,
    "random_vis": false,
    "ids": null,
    "show_off": true,
    "save_dir": "vis_bk/dior",
    "vis_nproc": 10,
    
    "shown_btype": null,
    "shown_names": "./vis_configs/dior/short_names.txt",
    "score_thr": 0.2,
    "colors": "./vis_configs/dior/colors.txt",
    "thickness": 3.0,
    "text_off": true,
    "font_size": 10,
    "wait_time": 0
    

    } The following error occurs: Traceback (most recent call last): File "visualize.py", line 230, in main() File "visualize.py", line 143, in main nproc=args.load_nproc) File "/data/bk/OBBDetection/BboxToolkit/BboxToolkit/datasets/io.py", line 54, in load_pkl old_classes, contents = data['cls'], data['content'] TypeError: list indices must be integers or slices, not str

    I output the data parsed by .pkl this is

    array([[ 7.8454449e+02, 6.3927423e+02, 2.6410254e+01, 8.1578226e+00, -1.2265325e-02, 7.9247594e-01], [ 5.6819104e+02, 6.5477740e+02, 1.5486428e+01, 8.1747618e+00, 1.5659013e+00, 7.7006650e-01], [ 5.7608038e+02, 6.5416187e+02, 1.5025672e+01, 8.0598936e+00, 1.5541477e+00, 6.8269205e-01], [ 5.7347760e+02, 6.9571722e+02, 1.3365779e+01, 5.5745769e+00, -1.5615332e+00, 4.7462189e-01], [ 5.7240784e+02, 6.5443042e+02, 1.5609086e+01, 1.1678979e+01, 1.5074093e+00, 4.4766316e-01], [ 5.3823401e+02, 6.5405450e+02, 1.7242418e+01, 1.0737660e+01, -1.5569979e+00, 2.6717269e-01], [ 6.1477234e+02, 1.3902811e+02, 3.6538612e+01, 8.9332752e+00, 1.4462376e-01, 1.9412568e-01], [ 5.7195233e+02, 6.5014233e+02, 1.4650148e+01, 8.8534908e+00, 5.1303148e-02, 1.0566589e-01], [ 5.4264069e+02, 6.5394983e+02, 1.8320833e+01, 1.6436756e+01, 1.5667925e+00, 5.3098477e-02]], dtype=float32), array([], shape=(0, 6), dtype=float32)] I would like to ask you what is the problem, looking forward to your reply

    opened by BooKing-hub 0
  • How does iof_thr work in the image_split.py?

    How does iof_thr work in the image_split.py?

    If I don't get it wrong, if the iou between hbbox of the objects and windows is less than the value of iou_thr, the object will be ignored. Right? I wonder why you do this?

    opened by Agito555 0
Owner
jbwang1997
Keep calm and carry on coding!!!
jbwang1997
Pytorch ImageNet1k Loader with Bounding Boxes.

ImageNet 1K Bounding Boxes For some experiments, you might wanna pass only the background of imagenet images vs passing only the foreground. Here, I'v

Amin Ghiasi 11 Oct 15, 2022
This repository is based on Ultralytics/yolov5, with adjustments to enable polygon prediction boxes.

Polygon-Yolov5 This repository is based on Ultralytics/yolov5, with adjustments to enable polygon prediction boxes. Section I. Description The codes a

xinzelee 226 Jan 5, 2023
This repository is based on Ultralytics/yolov5, with adjustments to enable rotate prediction boxes.

Rotate-Yolov5 This repository is based on Ultralytics/yolov5, with adjustments to enable rotate prediction boxes. Section I. Description The codes are

xinzelee 90 Dec 13, 2022
PyTorch implementation of Interpretable Explanations of Black Boxes by Meaningful Perturbation

PyTorch implementation of Interpretable Explanations of Black Boxes by Meaningful Perturbation The paper: https://arxiv.org/abs/1704.03296 What makes

Jacob Gildenblat 322 Dec 17, 2022
A simple python module to generate anchor (aka default/prior) boxes for object detection tasks.

PyBx WIP A simple python module to generate anchor (aka default/prior) boxes for object detection tasks. Calculated anchor boxes are returned as ndarr

thatgeeman 4 Dec 15, 2022
[ICLR 2022] DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR

DAB-DETR This is the official pytorch implementation of our ICLR 2022 paper DAB-DETR. Authors: Shilong Liu, Feng Li, Hao Zhang, Xiao Yang, Xianbiao Qi

null 336 Dec 25, 2022
The GitHub repository for the paper: “Time Series is a Special Sequence: Forecasting with Sample Convolution and Interaction“.

SCINet This is the original PyTorch implementation of the following work: Time Series is a Special Sequence: Forecasting with Sample Convolution and I

null 386 Jan 1, 2023
This code finds bounding box of a single human mouth.

This code finds bounding box of a single human mouth. In comparison to other face segmentation methods, it is relatively insusceptible to open mouth conditions, e.g., yawning, surgical robots, etc. The mouth coordinates are found in a more certified way using two independent algorithms. Therefore, the algorithm can be used in more sensitive applications.

iThermAI 4 Nov 27, 2022
Alpha-IoU: A Family of Power Intersection over Union Losses for Bounding Box Regression

Alpha-IoU: A Family of Power Intersection over Union Losses for Bounding Box Regression YOLOv5 with alpha-IoU losses implemented in PyTorch. Example r

Jacobi(Jiabo He) 147 Dec 5, 2022
A texturizer that I just made. Nothing special here.

texturizer This is a little project that I did with an hour's time. It texturizes an image given a image and a texture to texturize it with. There is

null 1 Nov 11, 2021
Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in 3D.

ApproxMVBB Status Build UnitTests Homepage Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in

Gabriel Nützi 390 Dec 31, 2022
Tools to create pixel-wise object masks, bounding box labels (2D and 3D) and 3D object model (PLY triangle mesh) for object sequences filmed with an RGB-D camera.

Tools to create pixel-wise object masks, bounding box labels (2D and 3D) and 3D object model (PLY triangle mesh) for object sequences filmed with an RGB-D camera. This project prepares training and testing data for various deep learning projects such as 6D object pose estimation projects singleshotpose, as well as object detection and instance segmentation projects.

null 305 Dec 16, 2022
Improving Object Detection by Estimating Bounding Box Quality Accurately

Improving Object Detection by Estimating Bounding Box Quality Accurately Abstrac

null 2 Apr 14, 2022
LQM - Improving Object Detection by Estimating Bounding Box Quality Accurately

Improving Object Detection by Estimating Bounding Box Quality Accurately Abstract Object detection aims to locate and classify object instances in ima

IM Lab., POSTECH 0 Sep 28, 2022
curl-impersonate: A special compilation of curl that makes it impersonate Chrome & Firefox

curl-impersonate A special compilation of curl that makes it impersonate real browsers. It can impersonate the four major browsers: Chrome, Edge, Safa

lwthiker 1.9k Jan 3, 2023
Technical Indicators implemented in Python only using Numpy-Pandas as Magic - Very Very Fast! Very tiny! Stock Market Financial Technical Analysis Python library . Quant Trading automation or cryptocoin exchange

MyTT Technical Indicators implemented in Python only using Numpy-Pandas as Magic - Very Very Fast! to Stock Market Financial Technical Analysis Python

dev 34 Dec 27, 2022
A tiny, pedagogical neural network library with a pytorch-like API.

candl A tiny, pedagogical implementation of a neural network library with a pytorch-like API. The primary use of this library is for education. Use th

Sri Pranav 3 May 23, 2022
A very tiny, very simple, and very secure file encryption tool.

Picocrypt is a very tiny (hence "Pico"), very simple, yet very secure file encryption tool. It uses the modern ChaCha20-Poly1305 cipher suite as well

Evan Su 1k Dec 30, 2022
XtremeDistil framework for distilling/compressing massive multilingual neural network models to tiny and efficient models for AI at scale

XtremeDistilTransformers for Distilling Massive Multilingual Neural Networks ACL 2020 Microsoft Research [Paper] [Video] Releasing [XtremeDistilTransf

Microsoft 125 Jan 4, 2023