Xeye#
Xeye is a package for data collection to build computer vision applications based on inferential results of deep learning models. The main reasons to use Xeye are:
Create a dataset using either a laptop with its integrated camera, a USB camera, or by utilizing an RTSP stream.
Create a dataset already structured like the mnist.
Create a dataset that can be used for building models with Tensorflow or Pytorch.
Installation#
To install the package,
pip install xeye
Functionalities#
The Xeye package includes two major approaches for creating a dataset from scratch: Dataset, and ManualDataset.
Dataset: Uses the constructor with all the specifications of the dataset.
ManualDataset: Same as Dataset, but every image is shot manually one at a time.
Additionally, the package provides a method for combining datasets created with the BuildDataset class.
Datasets for deep learning#
In the examples folder of the repository, you can find examples of deep learning model implementations based on datasets produced by the Xeye package (made with Tensorflow or Pytorch).
Binary dataset: containing two types of grayscale images (with labels: 0=keyboard, 1=mouse).
MultiLabel dataset: containing three types of rgb images (three types of security cameras with labels: 0=dome, 1=bullet, 2=cube)
Additionally, the examples folder of the repository contains scripts that use the Xeye package to build datasets (link).
Examples#
Hikvision Device#
With xeye, you can build a dataset using all Hikvision IP cameras updated to the ISAPI firmware.
from xeye import Dataset
data = Dataset(source='rtsp://admin:password@ip:port/ISAPI/Streaming/channels/101',
img_types=2, label=['a', 'b'], num=10, height=100, width=100, stand_by_time=0)
data.preview()
data.gray()
data.compress_train_test(perc=0.2)
data.compress_all()
data.just_compress(name="batch_test")
The RTSP stream uses, by default, port 554. If you change it in the device configuration, you need to use the port specified for the RTSP connection.
channels/101 = main stream.
channels/102 = sub stream.
If you want to obtain the RTSP stream from a camera connected to an Hikvision NVR, the number at the end of the RTSP stream indicates:
channels/101 = main stream of the first camera.
channels/102 = sub stream of the first camera.
channels/201 = main stream of the second camera.
channels/202 = sub stream of the second camera.
Integrated or USB connected camera#
Here is an example of the minimal amount of code to create a dataset using xeye with the laptop’s integrated camera:
from xeye import Dataset
data = Dataset(source=0, img_types=2, label=['a', 'b'], num=10, height=100, width=100, stand_by_time=0)
data.preview()
data.rgb()
data.compress_train_test(perc=0.2)
data.compress_all()
data.just_compress(name="batch_test")
source = 0 -> integrated camera.
source = 1 -> USB connected camera.
Contents: