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
This repository contains code released by Google Research.

This repository contains code released by Google Research.

Google Research 26.6k Dec 31, 2022
Power Core Simulator!

Power Core Simulator Power Core Simulator is a simulator based off the Roblox game "Pinewood Builders Computer Core". In this simulator, you can choos

BananaJeans 1 Nov 13, 2021
Code for "The Box Size Confidence Bias Harms Your Object Detector"

The Box Size Confidence Bias Harms Your Object Detector - Code Disclaimer: This repository is for research purposes only. It is designed to maintain r

Johannes G. 24 Dec 07, 2022
Understanding the Generalization Benefit of Model Invariance from a Data Perspective

Understanding the Generalization Benefit of Model Invariance from a Data Perspective This is the code for our NeurIPS2021 paper "Understanding the Gen

1 Jan 15, 2022
A high-performance Python-based I/O system for large (and small) deep learning problems, with strong support for PyTorch.

WebDataset WebDataset is a PyTorch Dataset (IterableDataset) implementation providing efficient access to datasets stored in POSIX tar archives and us

1.1k Jan 08, 2023
RefineGNN - Iterative refinement graph neural network for antibody sequence-structure co-design (RefineGNN)

Iterative refinement graph neural network for antibody sequence-structure co-des

Wengong Jin 83 Dec 31, 2022
Fully Convolutional DenseNets for semantic segmentation.

Introduction This repo contains the code to train and evaluate FC-DenseNets as described in The One Hundred Layers Tiramisu: Fully Convolutional Dense

485 Nov 26, 2022
Character Grounding and Re-Identification in Story of Videos and Text Descriptions

Character in Story Identification Network (CiSIN) This project hosts the code for our paper. Youngjae Yu, Jongseok Kim, Heeseung Yun, Jiwan Chung and

8 Dec 09, 2022
Anonymize BLM Protest Images

Anonymize BLM Protest Images This repository automates @BLMPrivacyBot, a Twitter bot that shows the anonymized images to help keep protesters safe. Us

Stanford Machine Learning Group 40 Oct 13, 2022
Extremely easy multi instancing software for minecraft speedrunning.

Easy Multi Extremely easy multi/single instancing software for minecraft speedrunning. A couple of goals of this project: Setup multi in minutes No fi

Duncan 8 Jul 16, 2022
Self-Supervised Pre-Training for Transformer-Based Person Re-Identification

Self-Supervised Pre-Training for Transformer-Based Person Re-Identification [pdf] The official repository for Self-Supervised Pre-Training for Transfo

Hao Luo 116 Jan 04, 2023
Answering Open-Domain Questions of Varying Reasoning Steps from Text

This repository contains the authors' implementation of the Iterative Retriever, Reader, and Reranker (IRRR) model in the EMNLP 2021 paper "Answering Open-Domain Questions of Varying Reasoning Steps

26 Dec 22, 2022
PyTorch implementation of "Contrast to Divide: self-supervised pre-training for learning with noisy labels"

Contrast to Divide: self-supervised pre-training for learning with noisy labels This is an official implementation of "Contrast to Divide: self-superv

55 Nov 23, 2022
A mini library for Policy Gradients with Parameter-based Exploration, with reference implementation of the ClipUp optimizer from NNAISENSE.

PGPElib A mini library for Policy Gradients with Parameter-based Exploration [1] and friends. This library serves as a clean re-implementation of the

NNAISENSE 56 Jan 01, 2023
Implementation of the GBST block from the Charformer paper, in Pytorch

Charformer - Pytorch Implementation of the GBST (gradient-based subword tokenization) module from the Charformer paper, in Pytorch. The paper proposes

Phil Wang 105 Dec 26, 2022
Redash reset for python

redash-reset This will use a default REDASH_SECRET_KEY key of c292a0a3aa32397cdb050e233733900f this allows you to reset the password of the user ID bu

Robert Wiggins 5 Nov 14, 2022
Temporal Knowledge Graph Reasoning Triggered by Memories

MTDM Temporal Knowledge Graph Reasoning Triggered by Memories To alleviate the time dependence, we propose a memory-triggered decision-making (MTDM) n

4 Sep 25, 2022
Kaggle: Cell Instance Segmentation

Kaggle: Cell Instance Segmentation The goal of this challenge is to detect cells in microscope images. with simple view on how many cels have been ann

Jirka Borovec 9 Aug 12, 2022
FOSS Digital Asset Distribution Platform built on Frappe.

Digistore FOSS Digital Assets Marketplace. Distribute digital assets, like a pro. Video Demo Here Features Create, attach and list digital assets (PDF

Mohammad Hussain Nagaria 30 Dec 08, 2022
GAT - Graph Attention Network (PyTorch) 💻 + graphs + 📣 = ❤️

GAT - Graph Attention Network (PyTorch) 💻 + graphs + 📣 = ❤️ This repo contains a PyTorch implementation of the original GAT paper ( 🔗 Veličković et

Aleksa Gordić 1.9k Jan 09, 2023