This is the module for detecting and classifying text on rama pictures
Project description
danila_lib v1.3.0
python library for Danila
To install project made
pip install danila-lib
To use in your project
from danila.danila import Danila
All use methods are in
class Danila
returns string - class of rama, img - openCV frame
def rama_classify(self, img):
returns openCV frame with rama from openCV frame\
def rama_detect(self, img):
returns openCV image with cut_rama
def rama_cut(self, img):
in package data/neuro there is module Rama_classify_class
class Rama_classify_class
reads CNN taught model and includes it in class example
def __init__():
makes grey NumPy Array(1,512,512) of doubles[0..1] from openCV image
def prepare_img(img : openCV frame): NumPy Array(1,512,512)[0..1]
classify openCV img with CNN, returns list with double[0..1] values
def work_img(img : openCV frame): Double[0..1] list
classify openCV img with CNN, returns Class_im
def classify(img : openCV frame): Class_im
in package data/neuro there is module Rama_detect_class
class Rama_detect_class
reads yolov5 taught model from yandex-disk and includes it in class example
def __init__(self, model_path, model_name, yolo_path):
получить JSON с результатами yolo
def work_img(self, img_path):
получить координаты прямоугольника с рамой
def rama_detect(self, img_path):
in package data/result Rect module for rectangle operations
прочитать из json результата йоло
@staticmethod
def get_rect_from_yolo_json(yolo_json):
makes Rect object from xmin, xmax, ymin, ymax
def __init__(self, xmin=0, xmax=0, ymin=0, ymax=0):
Найти IOU между этим прямоугольником и другим, данным в объекте
def IoU(self, rect):
makes string from object
def __str__(self):
find intersection square between object and other rectangle
def intersection(self, rect):
find union RECT between object and other rectangle
def union(self, rect):
in package data/result Class_im
class Class_im(Enum):
rama_no_spring = 0
rama_spring = 1
exapmles of using you can find
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
danila-lib-1.3.1.tar.gz
(7.9 kB
view hashes)
Built Distribution
danila_lib-1.3.1-py3-none-any.whl
(244.0 kB
view hashes)
Close
Hashes for danila_lib-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd5feee933d46eaea4c55002d3faeb33191e3fc2eff9731e6f523a9eb4de0dfc |
|
MD5 | 049f8c8fd0c3ba6cfac523d3878dedaa |
|
BLAKE2b-256 | f4392395c764279c957633091b2864150ae6995abb17417ae1a1bb449811f9e9 |