Skip to main content

Python package utils for computer vision

Project description

AVCV

Optimized functions for vision problems

%load_ext autoreload
%autoreload 2
from nbdev.showdoc import *

This file will become your README and also the index of your documentation.

Install

pip install avcv

How to use

plot_images[source]

plot_images(images, labels=None, cls_true=None, cls_pred=None, space=(0.3, 0.3), mxn=None, size=(5, 5), dpi=300, max_w=1500, out_file=None, cmap='binary')

Plot images

from avcv.visualize import plot_images
from glob import glob
import numpy as np
import mmcv
paths = glob('/data/synthetic/SHARE_SVA_DATASET/val/000/frames/*')
imgs = [mmcv.imread(path, channel_order='rgb') for path in np.random.choice(paths, 10)]
plot_images(imgs)
---------------------------------------------------------------------------

ModuleNotFoundError                       Traceback (most recent call last)

<ipython-input-4-c232fb9b8e39> in <module>
----> 1 from avcv.plot_images import plot_images
      2 from glob import glob
      3 import numpy as np
      4 import mmcv
      5 paths = glob('/data/synthetic/SHARE_SVA_DATASET/val/000/frames/*')


ModuleNotFoundError: No module named 'avcv.plot_images'

Multi thread

Elementwise multithreading a given function, the results are store in an array coresponding to the inputs

# example
from glob import glob
import mmcv
import numpy as np
from avcv.process import multi_thread
from tqdm import tqdm

paths = glob('/data/synthetic/SHARE_SVA_DATASET/val/000/frames/*')
def f(x):
    mmcv.imread(x, channel_order='rgb')
    return None

inputs = np.random.choice(paths, 100)
fast_imgs = multi_thread(f, inputs)
slow_imgs = [f(_) for _ in tqdm(inputs)]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avcv-0.0.1.tar.gz (10.6 kB view hashes)

Uploaded Source

Built Distribution

avcv-0.0.1-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page