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 pure pytorch implemented ocr project including text detection and recognition

ocr.pytorch A pure pytorch implemented ocr project. Text detection is based CTPN and text recognition is based CRNN. More detection and recognition me

coura 444 Dec 30, 2022
Balabobapy - Using artificial intelligence algorithms to continue the text

Balabobapy - Using artificial intelligence algorithms to continue the text

qxtony 1 Feb 04, 2022
Virtual Zoom Gesture using OpenCV

Virtual_Zoom_Gesture I have created a virtual zoom gesture where we can Zoom in and Zoom out any image and even we can move that image anywhere on the

Mudit Sinha 2 Dec 26, 2021
An OCR evaluation tool

dinglehopper dinglehopper is an OCR evaluation tool and reads ALTO, PAGE and text files. It compares a ground truth (GT) document page with a OCR resu

QURATOR-SPK 40 Dec 20, 2022
Um simples projeto para fazer o reconhecimento do captcha usado pelo jogo bombcrypto

CaptchaSolver - LEIA ISSO 😓 Para iniciar o codigo: pip install -r requirements.txt python captcha_solver.py Se você deseja pegar ver o resultado das

Kawanderson 50 Mar 21, 2022
TextBoxes re-implement using tensorflow

TextBoxes-TensorFlow TextBoxes re-implementation using tensorflow. This project is greatly inspired by slim project And many functions are modified ba

Gu Xiaodong 44 Dec 29, 2022
Python package for handwriting and sketching in Jupyter cells

ipysketch A Python package for handwriting and sketching in Jupyter notebooks. Usage A movie is worth a thousand pictures is worth a million words...

Matthias Baer 16 Jan 05, 2023
A simple QR-Code Reader in Python

A simple QR-Code Reader written in Python, that copies the content of a QR-Code directly into the copy clipboard.

Eric 1 Oct 28, 2021
Source code of RRPN ---- Arbitrary-Oriented Scene Text Detection via Rotation Proposals

Paper source Arbitrary-Oriented Scene Text Detection via Rotation Proposals https://arxiv.org/abs/1703.01086 News We update RRPN in pytorch 1.0! View

428 Nov 22, 2022
轻量级公式 OCR 小工具:一键识别各类公式图片,并转换为 LaTeX 格式

QC-Formula | 青尘公式 OCR 介绍 轻量级开源公式 OCR 小工具:一键识别公式图片,并转换为 LaTeX 格式。 支持从 电脑本地 导入公式图片;(后续版本将支持直接从网页导入图片) 公式图片支持 .png / .jpg / .bmp,大小为 4M 以内均可; 支持印刷体及手写体,前

青尘工作室 26 Jan 07, 2023
PSENet - Shape Robust Text Detection with Progressive Scale Expansion Network.

News Python3 implementations of PSENet [1], PAN [2] and PAN++ [3] are released at https://github.com/whai362/pan_pp.pytorch. [1] W. Wang, E. Xie, X. L

1.1k Dec 24, 2022
MXNet OCR implementation. Including text recognition and detection.

insightocr Text Recognition Accuracy on Chinese dataset by caffe-ocr Network LSTM 4x1 Pooling Gray Test Acc SimpleNet N Y Y 99.37% SE-ResNet34 N Y Y 9

Deep Insight 99 Nov 01, 2022
Handwritten Character Recognition using CNN

Handwritten Character Recognition using CNN Problem Definition The main objective of this project is to solve the problem of handwritten character rec

Mohit Kaushik 4 Mar 02, 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 retri

Happy N. Monday 3 Feb 15, 2022
Python bindings for JIGSAW: a Delaunay-based unstructured mesh generator.

JIGSAW: An unstructured mesh generator JIGSAW is an unstructured mesh generator and tessellation library; designed to generate high-quality triangulat

Darren Engwirda 26 Dec 13, 2022
Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless.

Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless. This is the official Roboflow python package that interfaces with the Roboflow API.

Roboflow 52 Dec 23, 2022
Links to awesome OCR projects

Awesome OCR This list contains links to great software tools and libraries and literature related to Optical Character Recognition (OCR). Contribution

Konstantin Baierer 2.2k Jan 02, 2023
LEARN OPENCV IN 3 HOURS USING PYTHON - INCLUDING EXAMPLE PROJECTS

LEARN OPENCV IN 3 HOURS USING PYTHON - INCLUDING EXAMPLE PROJECTS

Murtaza Hassan 815 Dec 29, 2022
Code related to "Have Your Text and Use It Too! End-to-End Neural Data-to-Text Generation with Semantic Fidelity" paper

DataTuner You have just found the DataTuner. This repository provides tools for fine-tuning language models for a task. See LICENSE.txt for license de

81 Jan 01, 2023
OpenCV-Erlang/Elixir bindings

evision [WIP] : OS : arch Build Status Ubuntu 20.04 arm64 Ubuntu 20.04 armv7 Ubuntu 20.04 s390x Ubuntu 20.04 ppc64le Ubuntu 20.04 x86_64 macOS 11 Big

Cocoa 194 Jan 05, 2023