One Metrics Library to Rule Them All!

Overview

PyPI version PyPI - License codecov PyPI - Python Version

onemetric

Logo

Installation

  • Install onemetric from PyPI (recommended):

    pip install onemetric
  • Install onemetric from the GitHub source:

    git clone https://github.com/SkalskiP/onemetric.git
    cd onemetric
    python setup.py install

Example

dataset-sample

Figure 1. Dataset sample, blue - ground-truth and red - detection.

Calculate [email protected]

>>> from onemetric.cv.loaders import YOLOLoader
>>> from onemetric.cv.object_detection import MeanAveragePrecision

>>> model = load_model(...)  # model-specific loading method

>>> data_set = YOLOLoader(
...     images_dir_path=DATA_SET_IMAGES_PATH, 
...     annotations_dir_path=DATA_SET_ANNOTATIONS_PATH
... ).load()

>>> true_batches, detection_batches = [], []
>>> for entry in data_set:
>>>     detections = model(entry.get_image())  # model-specific prediction method
>>>     true_batches.append(entry.get_annotations())
>>>     detection_batches.append(detections)

>>> mean_average_precision = MeanAveragePrecision.from_detections(
...     true_batches=true_batches, 
...     detection_batches=detection_batches, 
...     num_classes=12,
...     iou_threshold=0.5
... )

>>> mean_average_precision.value
0.61

Calculate Confusion Matrix

>>> confusion_matrix = ConfusionMatrix.from_detections(
...     true_batches=true_batches, 
...     detection_batches=detection_batches,
...     num_classes=12
... )

>>> confusion_matrix.plot(CONFUSION_MATRIX_TARGET_PATH, class_names=CLASS_NAMES)

dataset-sample

Figure 2. Create confusion matrix chart

Documentation

The official documentation is hosted on Github Pages: https://skalskip.github.io/onemetric

Contribute

Feel free to file issues or pull requests. Let us know what metrics should be part of onemetric!

Citation

Please cite onemetric in your publications if this is useful for your research. Here is an example BibTeX entry:

@MISC{onemetric,
   author = {Piotr Skalski},
   title = {{onemetric}},
   howpublished = "\url{https://github.com/SkalskiP/onemetric/}",
   year = {2021},
}

License

This project is licensed under the BSD 3 - see the LICENSE file for details.

You might also like...
Pre-Recognize Library - library with algorithms for improving OCR quality.

PRLib - Pre-Recognition Library. The main aim of the library - prepare image for recogntion. Image processing can really help to improve recognition q

Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.
Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.

EasyOCR Ready-to-use OCR with 80+ languages supported including Chinese, Japanese, Korean and Thai. What's new 1 February 2021 - Version 1.2.3 Add set

Repository collecting all the submodules for the new PyTorch-based OCR System.

OCRopus3 is being replaced by OCRopus4, which is a rewrite using PyTorch 1.7; release should be soonish. Please check github.com/tmbdev/ocropus for up

OCR engine for all the languages

Description kraken is a turn-key OCR system optimized for historical and non-Latin script material. kraken's main features are: Fully trainable layout

list all open dataset about ocr.

ocr-open-dataset list all open dataset about ocr. printed dataset year Born-Digital Images (Web and Email) 2011-2015 COCO-Text 2017 Text Extraction fr

A Screen Translator/OCR Translator made by using Python and Tesseract, the user interface are made using Tkinter. All code written in python.

About An OCR translator tool. Made by me by utilizing Tesseract, compiled to .exe using pyinstaller. I made this program to learn more about python. I

A community-supported supercharged version of paperless: scan, index and archive all your physical documents
A community-supported supercharged version of paperless: scan, index and archive all your physical documents

Paperless-ngx Paperless-ngx is a document management system that transforms your physical documents into a searchable online archive so you can keep,

Open Source Differentiable Computer Vision Library for PyTorch
Open Source Differentiable Computer Vision Library for PyTorch

Kornia is a differentiable computer vision library for PyTorch. It consists of a set of routines and differentiable modules to solve generic computer

Open Source Computer Vision Library

OpenCV: Open Source Computer Vision Library Resources Homepage: https://opencv.org Courses: https://opencv.org/courses Docs: https://docs.opencv.org/m

Comments
  • ModuleNotFoundError when installing with pip

    ModuleNotFoundError when installing with pip

    Describe the bug If installing the package with pip I can;t use the module MeanAveragePrecision. I receive the following error: ModuleNotFoundError: No module named 'onemetric.cv.object_detection'; 'onemetric.cv' is not a package It works if I download the repository and install using setup.py

    Screenshots image

    Environment

    • OS: Ubuntu 20.04
    • Python Version: 3.8.11
    • onemetric Version: 0.1.1
    bug 
    opened by bindas1 10
  • More detalied use for onemetric

    More detalied use for onemetric

    Hi, im interesting in this project, but i dont now how to send the batches to mAP metric for yolo. my yolo v2 generator generate batches like (batch_size, 13, 13, 5, 4 + 1 + n_classes), and the net produce a output shape like ground truth (batch_size, 13, 13, 5, 4 + 1 + n_classes). If i try onemetric it will be works well ?

    And if i do with a yolov3 or yolov4 model ? it work to ? or only work with DarkNet api ? im build all in TF. Thks a lot!

    opened by kascesar 3
Releases(0.1.2)
Owner
Piotr Skalski
AI Engineer @unleashlive | Founder @ makesense.ai | Computer Science Graduate @ AGH UST Cracow | Civil Engineering Graduate @ Cracow UoT
Piotr Skalski
Tools for manipulating and evaluating the hOCR format for representing multi-lingual OCR results by embedding them into HTML.

hocr-tools About About the code Installation System-wide with pip System-wide from source virtualenv Available Programs hocr-check -- check the hOCR f

OCRopus 285 Dec 8, 2022
OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched or copy-pasted. ocrmypdf # it's a scriptable c

jbarlow83 7.9k Jan 3, 2023
This repo contains a script that allows us to find range of colors in images using openCV, and then convert them into geo vectors.

Vectorizing color range This repo contains a script that allows us to find range of colors in images using openCV, and then convert them into geo vect

Development Seed 9 Jul 27, 2022
A Python script to capture images from multiple webcams at once and save them into your local machine

Capturing multiple images at once from Webcam Using OpenCV Capture multiple image by accessing the webcam of your system and save it to your machine.

Fazal ur Rehman 2 Apr 16, 2022
Tools for manipulating and evaluating the hOCR format for representing multi-lingual OCR results by embedding them into HTML.

hocr-tools About About the code Installation System-wide with pip System-wide from source virtualenv Available Programs hocr-check -- check the hOCR f

OCRopus 285 Dec 8, 2022
Automatically remove the mosaics in images and videos, or add mosaics to them.

Automatically remove the mosaics in images and videos, or add mosaics to them.

Hypo 1.4k Dec 30, 2022
Slice a single image into multiple pieces and create a dataset from them

OpenCV Image to Dataset Converter Slice a single image of Persian digits into mu

Meysam Parvizi 14 Dec 29, 2022
Total Text Dataset. It consists of 1555 images with more than 3 different text orientations: Horizontal, Multi-Oriented, and Curved, one of a kind.

Total-Text-Dataset (Official site) Updated on April 29, 2020 (Detection leaderboard is updated - highlighted E2E methods. Thank you shine-lcy.) Update

Chee Seng Chan 671 Dec 27, 2022
Image processing is one of the most common term in computer vision

Image processing is one of the most common term in computer vision. Computer vision is the process by which computers can understand images and videos, and how they are stored, manipulated, and retrieve details from them. OpenCV is an open source computer vision image processing library for machine learning, deep leaning and AI application which plays a major role in real-time operation which is very important in today’s systems.

Happy  N. Monday 3 Feb 15, 2022
Fast image augmentation library and easy to use wrapper around other libraries. Documentation: https://albumentations.ai/docs/ Paper about library: https://www.mdpi.com/2078-2489/11/2/125

Albumentations Albumentations is a Python library for image augmentation. Image augmentation is used in deep learning and computer vision tasks to inc

null 11.4k Jan 2, 2023