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
Zero-Shot Text-to-Image Generation VQGAN+CLIP Dockerized

VQGAN-CLIP-Docker About Zero-Shot Text-to-Image Generation VQGAN+CLIP Dockerized This is a stripped and minimal dependency repository for running loca

Kevin Costa 73 Sep 11, 2022
Source code and data from the RecSys 2020 article "Carousel Personalization in Music Streaming Apps with Contextual Bandits" by W. Bendada, G. Salha and T. Bontempelli

Carousel Personalization in Music Streaming Apps with Contextual Bandits - RecSys 2020 This repository provides Python code and data to reproduce expe

Deezer 48 Jan 02, 2023
A python library for self-supervised learning on images.

Lightly is a computer vision framework for self-supervised learning. We, at Lightly, are passionate engineers who want to make deep learning more effi

Lightly 2k Jan 08, 2023
Simulations for Turring patterns on an apically expanding domain. T

Turing patterns on expanding domain Simulations for Turring patterns on an apically expanding domain. The details about the models and numerical imple

Yue Liu 0 Aug 03, 2021
Dataset used in "PlantDoc: A Dataset for Visual Plant Disease Detection" accepted in CODS-COMAD 2020

PlantDoc: A Dataset for Visual Plant Disease Detection This repository contains the Cropped-PlantDoc dataset used for benchmarking classification mode

Pratik Kayal 109 Dec 29, 2022
Pytorch implementation of Integrating Tree Path in Transformer for Code Representation

This is an official Pytorch implementation of the approaches proposed in: Han Peng, Ge Li, Wenhan Wang, Yunfei Zhao, Zhi Jin “Integrating Tree Path in

Han Peng 16 Dec 23, 2022
[ICCV'21] NEAT: Neural Attention Fields for End-to-End Autonomous Driving

NEAT: Neural Attention Fields for End-to-End Autonomous Driving Paper | Supplementary | Video | Poster | Blog This repository is for the ICCV 2021 pap

254 Jan 02, 2023
PyTorch code for our ECCV 2020 paper "Single Image Super-Resolution via a Holistic Attention Network"

HAN PyTorch code for our ECCV 2020 paper "Single Image Super-Resolution via a Holistic Attention Network" This repository is for HAN introduced in the

五维空间 140 Nov 23, 2022
A python script to lookup Passport Index Dataset

visa-cli A python script to lookup Passport Index Dataset Installation pip install visa-cli Usage usage: visa-cli [-h] [-d DESTINATION_COUNTRY] [-f]

rand-net 16 Oct 18, 2022
Double pendulum simulator using a symplectic Euler's method and Hamiltonian mechanics

Symplectic Double Pendulum Simulator Double pendulum simulator using a symplectic Euler's method. The program calculates the momentum and position of

Scott Marino 1 Jan 12, 2022
Pytorch implementation of the popular Improv RNN model originally proposed by the Magenta team.

Pytorch Implementation of Improv RNN Overview This code is a pytorch implementation of the popular Improv RNN model originally implemented by the Mage

Sebastian Murgul 3 Nov 11, 2022
This is the official implementation of TrivialAugment and a mini-library for the application of multiple image augmentation strategies including RandAugment and TrivialAugment.

Trivial Augment This is the official implementation of TrivialAugment (https://arxiv.org/abs/2103.10158), as was used for the paper. TrivialAugment is

AutoML-Freiburg-Hannover 94 Dec 30, 2022
Dungeons and Dragons randomized content generator

Component based Dungeons and Dragons generator Supports Entity/Monster Generation NPC Generation Weapon Generation Encounter Generation Environment Ge

Zac 3 Dec 04, 2021
African language Speech Recognition - Speech-to-Text

Swahili-Speech-To-Text Table of Contents Swahili-Speech-To-Text Overview Scenario Approach Project Structure data: models: notebooks: scripts tests: l

2 Jan 05, 2023
A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.

Visdom A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Python. Overview Concepts Setup Usage API To

FOSSASIA 9.4k Jan 07, 2023
Code for C2-Matching (CVPR2021). Paper: Robust Reference-based Super-Resolution via C2-Matching.

C2-Matching (CVPR2021) This repository contains the implementation of the following paper: Robust Reference-based Super-Resolution via C2-Matching Yum

Yuming Jiang 151 Dec 26, 2022
Misc YOLOL scripts for use in the Starbase space sandbox videogame

starbase-misc Misc YOLOL scripts for use in the Starbase space sandbox videogame. Each directory contains standalone YOLOL scripts. They don't really

4 Oct 17, 2021
PassAPI is a password generator in hash format and fully developed in Python, with the aim of teaching how to handle and build

simple, elegant and safe Introduction PassAPI is a password generator in hash format and fully developed in Python, with the aim of teaching how to ha

Johnsz 2 Mar 02, 2022
MiraiML: asynchronous, autonomous and continuous Machine Learning in Python

MiraiML Mirai: future in japanese. MiraiML is an asynchronous engine for continuous & autonomous machine learning, built for real-time usage. Usage In

Arthur Paulino 25 Jul 27, 2022
A PaddlePaddle version image model zoo.

Paddle-Image-Models English | 简体中文 A PaddlePaddle version image model zoo. Install Package Install by pip: $ pip install ppim Install by wheel package

AgentMaker 131 Dec 07, 2022