A simple python module to generate anchor (aka default/prior) boxes for object detection tasks.

Overview

PyBx

WIP

A simple python module to generate anchor (aka default/prior) boxes for object detection tasks. Calculated anchor boxes are returned as ndarrays in pascal_voc format by default.

Installation

pip install pybx

Usage

To calculate the anchor boxes for a single feature size and aspect ratio, given the image size:

from pybx import anchor

image_sz = (300, 300, 3)
feature_sz = (10, 10)
asp_ratio = 1/2.

anchor.bx(image_sz, feature_sz, asp_ratio)

To calculate anchor boxes for multiple feature sizes and aspect ratios:

feature_szs = [(10, 10), (8, 8)]
asp_ratios = [1., 1/2., 2.]

anchor.bxs(image_sz, feature_szs, asp_ratios)

More on visualising the anchor boxes here.

Todo

  • Wrapper class for boxes with vis.draw() method
  • Companion notebook
  • IOU check (return best overlap boxes)
  • Return masks
  • Unit tests
  • Specific tests
    • feature_sz of different aspect ratios
    • image_sz of different aspect ratios
  • Move to setup.py
Comments
  • Build and refactor [nbdev]

    Build and refactor [nbdev]

    A refactored version of pybx built using nbdev.

    Added:

    • documentation page: docs, README.md, example walkthrough file
    • GH workflow tests

    Breaking changes:

    • Need area() and valid() are now properties of BaseBx, so .area and .valid would suffice
    • utils methods refactored to utils and ops
    opened by thatgeeman 0
  • Walkthrough issue for PIL mode.

    Walkthrough issue for PIL mode.

    In the step: Ask VisBx to use random logits with logits=True

    vis.VisBx(image_sz=image_sz, logits=True, feature_sz=feature_sz).show(anchors, labels)
    

    Returns a key error: KeyError: ((1, 1, 3), '<i8') and TypeError: Cannot handle this data type: (1, 1, 3), <i8 with PIL.

    good first issue 
    opened by thatgeeman 0
  • Patch 4: Docs, Improvements, Bug fixes

    Patch 4: Docs, Improvements, Bug fixes

    • Refactored major sections of pybx.basics and the BxType
    • Backwards incompatible!
    • Detailed docstrings for all methods and classes
    • Directly visualize arrays in VisBx()
    • Visualize, iterate, __add__ operations for BaseBx
    • Helper function to set and return BxType (get_bx)
    • Several verbal assertions and bug fixes
    • Fixes #3 #2
    • [dev] Updated tests
    opened by thatgeeman 0
  • TypeError: 'BaseBx' object is not iterable

    TypeError: 'BaseBx' object is not iterable

    Describe the bug draw method of vis module tries to iterate over BaseBx during visualisation

    To Reproduce Steps to reproduce the behavior:

    anns = {'label': 5,
     'x_min': 87.0,
     'y_min': 196.0,
     'x_max': 1013.0,
     'y_max': 2129.0}
    
    from pybx.ops import make_array
    coords, label = make_array(anns)
    
    b = bbx(coords, label)
    vis.draw(img, b)
    
    opened by thatgeeman 0
  • implemented IOU for `BaseBx` and added unittests

    implemented IOU for `BaseBx` and added unittests

    Main commits

    • implemented intersection-over-union (IOU) for BaseBx
    • added unittests for all modules
    • Implemented classmethod and bbx() for BaseBx class to convert all types to BaseBx
    • ops now handles all type conversions (json-array, list-array)
    • bug fixes, best caught:
      • BaseBx method xywh() flipped w and h
      • read keys in order of voc_keys for json annotations)
    • updated README.md and nbs/
    opened by thatgeeman 0
  • Region proposals

    Region proposals

    Is your feature request related to a problem? Please describe. Rather than creating a bunch of anchor boxes based on geometry, create region proposals based on classic signal processing.

    opened by thatgeeman 0
  • Fix notebook (walkthrough)

    Fix notebook (walkthrough)

    Describe the bug

    • [ ] walkthrough link fails
    • [ ] Code import os bug

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

    Smartphone (please complete the following information):

    • Device: [e.g. iPhone6]
    • OS: [e.g. iOS8.1]
    • Browser [e.g. stock browser, safari]
    • Version [e.g. 22]

    Additional context Add any other context about the problem here.

    opened by thatgeeman 0
  • Missing sidebar in documentation page

    Missing sidebar in documentation page

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

    Smartphone (please complete the following information):

    • Device: [e.g. iPhone6]
    • OS: [e.g. iOS8.1]
    • Browser [e.g. stock browser, safari]
    • Version [e.g. 22]

    Additional context Add any other context about the problem here.

    opened by thatgeeman 0
Releases(v0.3.0)
  • v0.3.0(Nov 20, 2022)

    A refactored version of pybx built using nbdev.

    Added:

    • documentation page: docs, README.md, example walkthrough file
    • GH workflow tests

    Breaking changes:

    • Need area() and valid() are now properties of BaseBx, so .area and .valid would suffice
    • utils methods refactored to utils and ops
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Jan 21, 2022)

    What's Changed

    • Patch 5: Minor fixes by @thatgeeman in https://github.com/thatgeeman/pybx/pull/5
    • Patch 4: Docs, Improvements, Bug fixes by @thatgeeman in https://github.com/thatgeeman/pybx/pull/4

    Full Changelog: https://github.com/thatgeeman/pybx/compare/v0.1.4...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Jan 18, 2022)

    What's Changed

    • implemented IOU for BaseBx and added unittests by @thatgeeman in https://github.com/thatgeeman/pybx/pull/1

    New Contributors

    • @thatgeeman made their first contribution in https://github.com/thatgeeman/pybx/pull/1

    Full Changelog: https://github.com/thatgeeman/pybx/compare/v0.1.3...v0.1.4

    Source code(tar.gz)
    Source code(zip)
Owner
thatgeeman
Physics PhD. Previously @CharlesSadron @CNRS @unistra. Computer Vision.
thatgeeman
【CVPR 2021, Variational Inference Framework, PyTorch】 From Rain Generation to Rain Removal

From Rain Generation to Rain Removal (CVPR2021) Hong Wang, Zongsheng Yue, Qi Xie, Qian Zhao, Yefeng Zheng, and Deyu Meng [PDF&&Supplementary Material]

Hong Wang 48 Nov 23, 2022
Deep-learning X-Ray Micro-CT image enhancement, pore-network modelling and continuum modelling

EDSR modelling A Github repository for deep-learning image enhancement, pore-network and continuum modelling from X-Ray Micro-CT images. The repositor

Samuel Jackson 7 Nov 03, 2022
Dictionary Learning with Uniform Sparse Representations for Anomaly Detection

Dictionary Learning with Uniform Sparse Representations for Anomaly Detection Implementation of the Uniform DL Representation for AD algorithm describ

Paul Irofti 1 Nov 23, 2022
5 Jan 05, 2023
Continuous Diffusion Graph Neural Network

We present Graph Neural Diffusion (GRAND) that approaches deep learning on graphs as a continuous diffusion process and treats Graph Neural Networks (GNNs) as discretisations of an underlying PDE.

Twitter Research 227 Jan 05, 2023
GNN-based Recommendation Benchmark

GRecX A Fair Benchmark for GNN-based Recommendation Homepage and Documentation Homepage: Documentation: Paper: GRecX: An Efficient and Unified Benchma

73 Oct 17, 2022
Doods2 - API for detecting objects in images and video streams using Tensorflow

DOODS2 - Return of DOODS Dedicated Open Object Detection Service - Yes, it's a b

Zach 101 Jan 04, 2023
Reinforcement-learning - Repository of the class assignment questions for the course on reinforcement learning

DSE 314/614: Reinforcement Learning This repository containing reinforcement lea

Manav Mishra 4 Apr 15, 2022
Unofficial PyTorch Implementation of "Augmenting Convolutional networks with attention-based aggregation"

Pytorch Implementation of Augmenting Convolutional networks with attention-based aggregation This is the unofficial PyTorch Implementation of "Augment

DK 20 Sep 09, 2022
Pytorch implementation for Patient Knowledge Distillation for BERT Model Compression

Patient Knowledge Distillation for BERT Model Compression Knowledge distillation for BERT model Installation Run command below to install the environm

Siqi 180 Dec 19, 2022
Jittor implementation of Recursive-NeRF: An Efficient and Dynamically Growing NeRF

Recursive-NeRF: An Efficient and Dynamically Growing NeRF This is a Jittor implementation of Recursive-NeRF: An Efficient and Dynamically Growing NeRF

33 Nov 30, 2022
Code for the paper "On the Power of Edge Independent Graph Models"

Edge Independent Graph Models Code for the paper: "On the Power of Edge Independent Graph Models" Sudhanshu Chanpuriya, Cameron Musco, Konstantinos So

Konstantinos Sotiropoulos 0 Oct 26, 2021
A small library for creating and manipulating custom JAX Pytree classes

Treeo A small library for creating and manipulating custom JAX Pytree classes Light-weight: has no dependencies other than jax. Compatible: Treeo Tree

Cristian Garcia 58 Nov 23, 2022
LaneDetectionAndLaneKeeping - Lane Detection And Lane Keeping

LaneDetectionAndLaneKeeping This project is part of my bachelor's thesis. The go

5 Jun 27, 2022
In this project we combine techniques from neural voice cloning and musical instrument synthesis to achieve good results from as little as 16 seconds of target data.

Neural Instrument Cloning In this project we combine techniques from neural voice cloning and musical instrument synthesis to achieve good results fro

Erland 127 Dec 23, 2022
PyTorch Implementation of PIXOR: Real-time 3D Object Detection from Point Clouds

PIXOR: Real-time 3D Object Detection from Point Clouds This is a custom implementation of the paper from Uber ATG using PyTorch 1.0. It represents the

Philip Huang 270 Dec 14, 2022
Accelerating BERT Inference for Sequence Labeling via Early-Exit

Sequence-Labeling-Early-Exit Code for ACL 2021 paper: Accelerating BERT Inference for Sequence Labeling via Early-Exit Requirement: Please refer to re

李孝男 23 Oct 14, 2022
A Genetic Programming platform for Python with TensorFlow for wicked-fast CPU and GPU support.

Karoo GP Karoo GP is an evolutionary algorithm, a genetic programming application suite written in Python which supports both symbolic regression and

Kai Staats 149 Jan 09, 2023
Implement object segmentation on images using HOG algorithm proposed in CVPR 2005

HOG Algorithm Implementation Description HOG (Histograms of Oriented Gradients) Algorithm is an algorithm aiming to realize object segmentation (edge

Leo Hsieh 2 Mar 12, 2022
MVGCN: a novel multi-view graph convolutional network (MVGCN) framework for link prediction in biomedical bipartite networks.

MVGCN MVGCN: a novel multi-view graph convolutional network (MVGCN) framework for link prediction in biomedical bipartite networks. Developer: Fu Hait

13 Dec 01, 2022