Skip to main content

image tools for deep learning

Project description

Introduction

yyimg is a high-level image-processing tool, written in Python and using OpenCV as backbend. This repo helps you with processing images for your deep learning projects.

Installation

Commands to install from pip or download the source code from our website https://pypi.org/project/yyimg

$ pip3 install yyimg==1.0.0rc

Example Useage

Take one image in Kitti dataset for example:

import yyimg
from PIL import Image
image, boxes, classes = yyimg.load_data()
Items Description
image a numpy array of shape (height, width, #channels)
boxes a numpy array of shape (N, 5), representing N 2Dboxes of [class_index, xmin, ymin, xmax, ymax]
classes a list of class names
print(classes)
['Car', 'Truck', 'Van', 'Pedestrian']

visualize 2D boxes

draw_image = yyimg.draw_2Dbox(image, boxes, class_category=classes)
draw_image = cv2.cvtColor(draw_image, cv2.COLOR_BGR2RGB) # BGR -> RGB
Image.fromarray(draw_image).show()

image

data augmentation

- horizontal_flip

with 2D bounding boxes:

aug_image, boxes = yyimg.horizontal_flip(image, boxes)

without 2D bounding boxes:

aug_image = yyimg.horizontal_flip(image)

image

- add_rain

aug_image = yyimg.add_rain(image)

image

- shift_gama

aug_image = yyimg.shift_gamma(image) 

image

- shift_brightness

aug_image = yyimg.shift_brightness(image)

image

- shift_color

aug_image = yyimg.shift_color(image)

image

Project details


Download files

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

Files for yyimg, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size yyimg-1.0.2-py3-none-any.whl (840.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size yyimg-1.0.2.tar.gz (839.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page