Coder Social home page Coder Social logo

saafke / bop_toolkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thodan/bop_toolkit

0.0 0.0 0.0 288 KB

A Python toolkit of the BOP benchmark for 6D object pose estimation.

Home Page: http://bop.felk.cvut.cz

License: MIT License

Python 100.00%

bop_toolkit's Introduction

BOP Toolkit

A Python toolkit of the BOP benchmark for 6D object pose estimation (http://bop.felk.cvut.cz).

  • bop_toolkit_lib - The core Python library for i/o operations, calculation of pose errors, Python based rendering etc.
  • docs - Documentation and conventions.
  • scripts - Scripts for evaluation, rendering of training images, visualization of 6D object poses etc.

Installation

Python Dependencies

To install the required python libraries, run:

pip install -r requirements.txt -e .

In the case of problems, try to first run: pip install --upgrade pip setuptools

Vispy Renderer (default)

The Python based headless renderer with egl backend is implemented using Vispy. Vispy is installed using the pip command above. Note that the nvidia opengl driver might be required in case of any errors.

Python Renderer (deprecated)

Another Python based renderer is implemented using Glumpy which depends on freetype and GLFW. This implementation is similar to the vispy renderer since glumpy and vispy have similar apis, but this renderer does not support headless rendering. Glumpy is installed using the pip command above. On Linux, freetype and GLFW can be installed by:

apt-get install freetype
apt-get install libglfw3

To install freetype and GLFW on Windows, follow these instructions.

GLFW serves as a backend of Glumpy. Another backend can be used but were not tested with our code.

C++ Renderer

For fast CPU-based rendering on a headless server, we recommend installing bop_renderer, an off-screen C++ renderer with Python bindings.

Usage

1. Get the BOP datasets

Download the BOP datasets and make sure they are in the expected folder structure.

2. Run your method

Estimate poses and save them in one .csv file per dataset (format description).

3. Configure the BOP Toolkit

In bop_toolkit_lib/config.py, set paths to the BOP datasets, to a folder with results to be evaluated, and to a folder for the evaluation output. The other parameters are necessary only if you want to visualize results or run the C++ Renderer.

4. Evaluate the pose estimates

python scripts/eval_bop19.py --renderer_type=vispy --result_filenames=NAME_OF_CSV_WITH_RESULTS

--renderer_type: "vispy", "python", or "cpp" (We recommend using "vispy" since it is easy to install and works headlessly. For "cpp", you need to install the C++ Renderer bop_renderer.).

--result_filenames: Comma-separated filenames with pose estimates in .csv (examples).

5. Evaluate the detections / instance segmentations

python scripts/eval_bop_coco.py --result_filenames=NAME_OF_JSON_WITH_COCO_RESULTS --ann_type='bbox'

--result_filenames: Comma-separated filenames with per-dataset coco results (place them under your results_path defined in your config.py).
--ann_type: 'bbox' to evaluate amodal bounding boxes. 'segm' to evaluate segmentation masks.

Convert BOP to COCO format

python scripts/calc_gt_coco.py

Set the dataset and split parameters in the top section of the script.

Manual annotation tool

To annotate a new dataset in BOP format use this tool.

First install Open3d dependency

pip install open3d==0.15.2

Edit the file paths in parameters section at the beginning of the file then run:

python scripts/annotation_tool.py

Interface:

Control the object pose with the following keys i: up, ,: down, j: front, k:back, h:left, l:right

Translation/rotation mode:

  • Shift not clicked: translation mode
  • Shift clicked: rotation model

Distance/angle big or small:

  • Ctrl not clicked: small distance(1mm) / angle(2deg)
  • Ctrl clicked: big distance(5cm) / angle(90deg)

R or "Refine" button will call ICP algorithm to do local refinement of the annotation

bop_toolkit's People

Contributors

thodan avatar martinsmeyer avatar wangg12 avatar anasibrahim avatar fegorschigd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.