Create dataset for computer vision application
Project description
Introduction
Xeye is a package for create dataset for computer vision application based on inferencial results of deep learning models. Xeye is born for these main reasons:
- Create dataset using only a laptop and its integrated camera (or alternatively an external usb camera);
- Create dataset already structured like the mnist;
- Create dataset that can be use for build models with Tensorflow or Pytorch.
Installation
To install the current release,
pip install xeye
Dynamic API UI
First of all, load the module datapipe from the package:
from xeye import datapipe as dp
then initialize the instance like this
data = dp.dataset()
set the parameters related to the images with the init function
data.init()
the execution of this function cause the starting of the user interface in terminal
--- CAMERA SETTING ---
Select index of the camera that you want to use for create the dataset: 0
the init() function arise multiple questions that set the parameters values
--- IMAGE SETTINGS ---
How many types of images do you want to scan: 2
Name of image type (1): keyboard
Name of image type (2): mouse
How many frames do you want to shoot for every image type:20
Single frame HEIGHT: 720
Single frame WIDTH: 720
num. of waiting time (in sec.) between every frame: 0
in more detail the questions refer to:
- Select index of the camera that you want to use for create the dataset: generally 0 for inernal camera 1 for usb external camera.
- How many types of images do you want to scan: answer 2 if you want to create a dataset with 2 objects (e.g. keyboard and mouse)...answer with the number of objects types that you want to include in your dataset.
- Name of image type: insert the name for every specif object that you you want to include in the dataset. The init function create a named folder for every images types to include.
- How many frames do you want to shoot for every image type: select the number of images do you want to shoot and save in every object folder that compose the dataset.
- Single frame HEIGHT: frame height values.
- Single frame WIDTH: frame width values.
- num. of waiting time (in sec.) between every frame: e.g 0.2 cause a waiting time of 0.2 seconds between every shoot.
After having set the parameters you can invoke the function for start shooting images. Datapipe module provides two different formats for images:
- Grayscale image with the gray() function;
- Color image with the rgb() function.
Let's produce a dataset based on rgb images with the rgb() function:
data.rgb()
in terminal press b to start making photos for the image types passed to the init() function
--- START TAKING PHOTOS ---
Press 'b' on keyboard to start data collection for image type keyboard
b
Press 'b' on keyboard to start data collection for image type mouse
b
On the directory of the script, you can find the folders that contain the images produced by the rbg() function (e.g. keyboard folder and mouse folder).
$\dots$
Images collected in the folders can be used for build dataset like the mnist. The first approch to achive this result is calling the compressTrainTest() function:
data.compressTrainTest()
that produce the following output in the terminal window
--- DATASET SETTING ---
percentage of images in test dataset: 0.2
in which you can select the portion of images to use in train set and in test set (writing a values between [0,1]). So the function produce a .npz files formed by this specific tensors:
- Train set:
- X_train: matrices/tensors of every single images in train set;
- y_train: classes (ordinal values) associated to every single images in train set.
- Test set:
- X_test: matrices/tensors of every single images in test set;
- y_test: classes (ordinal values) associated to every single images in test set.
An alternative approch is represent by the use of the function compressAll
data.compressAll()
in which the images is grouped in a unique tensor that contain all the frames produced before.
- Unique tensor:
- X: matricies/tensors of every single images produced;
- y: classes (ordinal values) associated to every single images produced.
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
Built Distribution
File details
Details for the file xeye-0.1.tar.gz
.
File metadata
- Download URL: xeye-0.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0b821271a2940f9cdb2d4f95e11d42657027c745c0b7d5484dffe5722db9887 |
|
MD5 | d45875f14dfb072b58d9b374c6899959 |
|
BLAKE2b-256 | 1cc50aa78c4b818d991aacb2aeeab9dc2a33ce168aba0d822aaee953389243c4 |
File details
Details for the file xeye-0.1-py3-none-any.whl
.
File metadata
- Download URL: xeye-0.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16817c548e8fd84369d73dd5ce3d7de9573922fe1f974802ed160df6bc07e5d2 |
|
MD5 | 1b14c675916573381226d25c47e80e57 |
|
BLAKE2b-256 | 56f6a27c6cf4cb1d055d5e79b1bc192a420394bc223f578ccc68f4b547766bfe |