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
Hyperopt for solving CIFAR-100 with a convolutional neural network (CNN) built with Keras and TensorFlow, GPU backend

Hyperopt for solving CIFAR-100 with a convolutional neural network (CNN) built with Keras and TensorFlow, GPU backend This project acts as both a tuto

Guillaume Chevalier 103 Jul 22, 2022
Adversarial Graph Augmentation to Improve Graph Contrastive Learning

ADGCL : Adversarial Graph Augmentation to Improve Graph Contrastive Learning Introduction This repo contains the Pytorch [1] implementation of Adversa

susheel suresh 62 Nov 19, 2022
[ACL 2022] LinkBERT: A Knowledgeable Language Model 😎 Pretrained with Document Links

LinkBERT: A Knowledgeable Language Model Pretrained with Document Links This repo provides the model, code & data of our paper: LinkBERT: Pretraining

Michihiro Yasunaga 264 Jan 01, 2023
A denoising autoencoder + adversarial losses and attention mechanisms for face swapping.

faceswap-GAN Adding Adversarial loss and perceptual loss (VGGface) to deepfakes'(reddit user) auto-encoder architecture. Updates Date Update 2018-08-2

3.2k Dec 30, 2022
TensorFlow implementation of ENet, trained on the Cityscapes dataset.

segmentation TensorFlow implementation of ENet (https://arxiv.org/pdf/1606.02147.pdf) based on the official Torch implementation (https://github.com/e

Fredrik Gustafsson 248 Dec 16, 2022
Large-Scale Unsupervised Object Discovery

Large-Scale Unsupervised Object Discovery Huy V. Vo, Elena Sizikova, Cordelia Schmid, Patrick Pérez, Jean Ponce [PDF] We propose a novel ranking-based

17 Sep 19, 2022
Implementation of Uformer, Attention-based Unet, in Pytorch

Uformer - Pytorch Implementation of Uformer, Attention-based Unet, in Pytorch. It will only offer the concat-cross-skip connection. This repository wi

Phil Wang 72 Dec 19, 2022
Exploration-Exploitation Dilemma Solving Methods

Exploration-Exploitation Dilemma Solving Methods Medium article for this repo - HERE In ths repo I implemented two techniques for tackling mentioned t

Aman Mishra 6 Jan 25, 2022
Keras-tensorflow implementation of Fully Convolutional Networks for Semantic Segmentation(Unfinished)

Keras-FCN Fully convolutional networks and semantic segmentation with Keras. Models Models are found in models.py, and include ResNet and DenseNet bas

645 Dec 29, 2022
Implementation of "Semi-supervised Domain Adaptive Structure Learning"

Semi-supervised Domain Adaptive Structure Learning - ASDA This repo contains the source code and dataset for our ASDA paper. Illustration of the propo

3 Dec 13, 2021
BridgeGAN - Tensorflow implementation of Bridging the Gap between Label- and Reference-based Synthesis in Multi-attribute Image-to-Image Translation.

Bridging the Gap between Label- and Reference based Synthesis(ICCV 2021) Tensorflow implementation of Bridging the Gap between Label- and Reference-ba

huangqiusheng 8 Jul 13, 2022
All public open-source implementations of convnets benchmarks

convnet-benchmarks Easy benchmarking of all public open-source implementations of convnets. A summary is provided in the section below. Machine: 6-cor

Soumith Chintala 2.7k Dec 30, 2022
Advancing mathematics by guiding human intuition with AI

Advancing mathematics by guiding human intuition with AI This repo contains two colab notebooks which accompany the paper, available online at https:/

DeepMind 315 Dec 26, 2022
Dynamic Attentive Graph Learning for Image Restoration, ICCV2021 [PyTorch Code]

Dynamic Attentive Graph Learning for Image Restoration This repository is for GATIR introduced in the following paper: Chong Mou, Jian Zhang, Zhuoyuan

Jian Zhang 84 Dec 09, 2022
Novel and high-performance medical image classification pipelines are heavily utilizing ensemble learning strategies

An Analysis on Ensemble Learning optimized Medical Image Classification with Deep Convolutional Neural Networks Novel and high-performance medical ima

14 Dec 18, 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
Anti-Adversarially Manipulated Attributions for Weakly and Semi-Supervised Semantic Segmentation (CVPR 2021)

Anti-Adversarially Manipulated Attributions for Weakly and Semi-Supervised Semantic Segmentation Input Image Initial CAM Successive Maps with adversar

Jungbeom Lee 110 Dec 07, 2022
《Towards High Fidelity Face Relighting with Realistic Shadows》(CVPR 2021)

Towards High Fidelity Face-Relighting with Realistic Shadows Andrew Hou, Ze Zhang, Michel Sarkis, Ning Bi, Yiying Tong, Xiaoming Liu. In CVPR, 2021. T

114 Dec 10, 2022
Seeing All the Angles: Learning Multiview Manipulation Policies for Contact-Rich Tasks from Demonstrations

Seeing All the Angles: Learning Multiview Manipulation Policies for Contact-Rich Tasks from Demonstrations Trevor Ablett, Daniel (Yifan) Zhai, Jonatha

STARS Laboratory 3 Feb 01, 2022
[BMVC2021] "TransFusion: Cross-view Fusion with Transformer for 3D Human Pose Estimation"

TransFusion-Pose TransFusion: Cross-view Fusion with Transformer for 3D Human Pose Estimation Haoyu Ma, Liangjian Chen, Deying Kong, Zhe Wang, Xingwei

Haoyu Ma 29 Dec 23, 2022