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
A little but useful tool to explore OCR data extracted with `pytesseract` and `opencv`

Screenshot OCR Tool Extracting data from screen time screenshots in iOS and Android. We are exploring 3 options: Simple OCR with no text position usin

Gabriele Marini 1 Dec 07, 2021
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 08, 2022
Simple app for visual editing of Page XML files

Name nw-page-editor - Simple app for visual editing of Page XML files. Version: 2021.02.22 Description nw-page-editor is an application for viewing/ed

Mauricio Villegas 27 Jun 20, 2022
code for our ICCV 2021 paper "DeepCAD: A Deep Generative Network for Computer-Aided Design Models"

DeepCAD This repository provides source code for our paper: DeepCAD: A Deep Generative Network for Computer-Aided Design Models Rundi Wu, Chang Xiao,

Rundi Wu 85 Dec 31, 2022
This is a implementation of CRAFT OCR method

This is a implementation of CRAFT OCR method

Esaka 0 Nov 01, 2021
a deep learning model for page layout analysis / segmentation.

OCR Segmentation a deep learning model for page layout analysis / segmentation. dependencies tensorflow1.8 python3 dataset: uw3-framed-lines-degraded-

99 Dec 12, 2022
Natural language detection

Detect the language of text. What’s so cool about franc? franc can support more languages(†) than any other library franc is packaged with support for

Titus 3.8k Jan 02, 2023
Camelot: PDF Table Extraction for Humans

Camelot: PDF Table Extraction for Humans Camelot is a Python library that makes it easy for anyone to extract tables from PDF files! Note: You can als

Atlan Technologies Pvt Ltd 3.3k Dec 31, 2022
POT : Python Optimal Transport

This open source Python library provide several solvers for optimization problems related to Optimal Transport for signal, image processing and machine learning.

Python Optimal Transport 1.7k Jan 04, 2023
Code for AAAI 2021 paper: Sequential End-to-end Network for Efficient Person Search

This repository hosts the source code of our paper: [AAAI 2021]Sequential End-to-end Network for Efficient Person Search. SeqNet achieves the state-of

Zj Li 218 Dec 31, 2022
Let's explore how we can extract text from forms

Form Segmentation Let's explore how we can extract text from any forms / scanned pages. Objectives The goal is to find an algorithm that can extract t

Philip Doxakis 42 Jun 05, 2022
Brief idea about our project is mentioned in project presentation file.

Brief idea about our project is mentioned in project presentation file. You just have to run attendance.py file in your suitable IDE but we prefer jupyter lab.

Dhruv ;-) 3 Mar 20, 2022
Simple SDF mesh generation in Python

Generate 3D meshes based on SDFs (signed distance functions) with a dirt simple Python API.

Michael Fogleman 1.1k Jan 08, 2023
Multi-Oriented Scene Text Detection via Corner Localization and Region Segmentation

This is the official implementation of "Multi-Oriented Scene Text Detection via Corner Localization and Region Segmentation". For more details, please

Pengyuan Lyu 309 Dec 06, 2022
Handwritten Text Recognition (HTR) system implemented with TensorFlow.

Handwritten Text Recognition with TensorFlow Update 2021: more robust model, faster dataloader, word beam search decoder also available for Windows Up

Harald Scheidl 1.5k Jan 07, 2023
TensorFlow Implementation of FOTS, Fast Oriented Text Spotting with a Unified Network.

FOTS: Fast Oriented Text Spotting with a Unified Network I am still working on this repo. updates and detailed instructions are coming soon! Table of

Masao Taketani 52 Nov 11, 2022
OpenMMLab Text Detection, Recognition and Understanding Toolbox

Introduction English | 简体中文 MMOCR is an open-source toolbox based on PyTorch and mmdetection for text detection, text recognition, and the correspondi

OpenMMLab 3k Jan 07, 2023
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
This repository contains the code for the paper "SCANimate: Weakly Supervised Learning of Skinned Clothed Avatar Networks"

SCANimate: Weakly Supervised Learning of Skinned Clothed Avatar Networks (CVPR 2021 Oral) This repository contains the official PyTorch implementation

Shunsuke Saito 235 Dec 18, 2022
ScanTailor Advanced is the version that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and fixes.

ScanTailor Advanced The ScanTailor version that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and f

952 Dec 31, 2022