Skip to main content

Read Image Directory or Image List simultaneously with multi-processing

Project description

Concurrent-Image-Read

PyPI Status PyPI Status PyPI Status

Author : Aditya Mangal PyPI Status


Concurrent-Image-Read is a python module to read Image Files or Image List Concurrently with multi-threading

Installation

Dependencies

  • Python (>= 3.7)
  • cv2 (>= 4.5)
  • NumPy (>= 1.17)
  • glob (>= 0.7)
  • future (>= 0.18.2)

User installation

pip install ConcurrentImageRead

Source code

You can check the latest sources with the command:
git clone https://github.com/adityamangal1998/Concurrent-Image-Read.git

Usage

Default Parameters

    read function
  • image_list = List or Numpy array or Single Path of image
  • num_threads = Number of threads (default 3) (optional)
  • channel_type = BGR or RBG (default BGR) (optional)
  • root_path = String, Parent path for all files (optional)
  • grayscale = True or False (optional)
  • resize = List or Tuple resize scale in (width,height) (optional)
  • normalisation = True or False, Image array divide by 255 (optional)
    read_dir function
  • dir_path = String, Path of Image Directory
  • file_type = 'all' or 'PNG','JPG',...etc or ['JPG','PNG',...] (case sensitive) (default png) (optional)
  • num_threads = Number of threads (default 3) (optional)
  • channel_type = BGR or RBG (default BGR) (optional)
  • sub_dir = Bool, Find all Images in all child directory also (default False) (optional)
  • grayscale = True or False (optional)
  • normalisation = True or False, Image array divide by 255 (optional)
    read_camera function
  • source = Integer for Webcam or String for Path of Camera or List of Cameras
  • num_threads = Number of threads (default 3) (optional)
  • fps = Integer in seconds, Frame per seconds (optional)
  • end_time_sec = Integer in seconds, end time of camera (optional)
  • channel_type = BGR or RBG (default BGR) (optional)
  • grayscale = True or False (optional)
  • normalisation = True or False, Image array divide by 255 (optional)
    read_video_file function
  • source = List or Numpy array or Single Path of Video
  • num_threads = Number of threads (default 3) (optional)
  • fps = Integer in seconds, Frame per seconds (optional)
  • end_time_sec = Integer in seconds, end time of camera (optional)
  • channel_type = BGR or RBG (default BGR) (optional)
  • root_path = String, Parent path for all files (optional)
  • grayscale = True or False (optional)
  • normalisation = True or False, Image array divide by 255 (optional)

With Image List

You can check the latest sources with the command:
import ConcurrentImageRead as CIR
image_list = ['1.png','2.png','3.png']
images = CIR.read(image_list,num_threads=3, channel_type='BGR',root_path='data')

With Image Path

import ConcurrentImageRead as CIR
image_path = '1.png'
images = CIR.read(image_list,num_threads=3, channel_type='BGR',root_path='data')

With Directory Path

import ConcurrentImageRead as CIR
dir_path = 'data/images'
images = CIR.read_dir(dir_path,file_type='png', num_threads=3, channel_type='BGR', sub_dir=False)

With Camera List

import ConcurrentImageRead as CIR
camera_sources = [0,1,2]
images = CIR.read_camera(camera_sources,num_threads=3,fps=1,end_time_sec=10,channel_type='RGB',normalisation=True,resize=(200,200))

With Camera Path

import ConcurrentImageRead as CIR
camera_source = 0
# camera_source = camera url
images = CIR.read_camera(camera_source,num_threads=3,fps=1,end_time_sec=10,channel_type='RGB',normalisation=True,resize=(200,200))

With Video List

import ConcurrentImageRead as CIR
video_list = ['1.mp4','2.mp4']
images = CIR.read_video_file(video_list,num_threads=3,fps=1,root_path='data',end_time_sec=10,channel_type='RGB',normalisation=True,resize=(200,200))

With Video Path

import ConcurrentImageRead as CIR
video_path = '1.mp4'
images = CIR.read_video_file(video_path,num_threads=3,fps=1,end_time_sec=10,channel_type='RGB',normalisation=True,resize=(200,200))

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

ConcurrentImageRead-0.0.10.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ConcurrentImageRead-0.0.10-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file ConcurrentImageRead-0.0.10.tar.gz.

File metadata

  • Download URL: ConcurrentImageRead-0.0.10.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.7

File hashes

Hashes for ConcurrentImageRead-0.0.10.tar.gz
Algorithm Hash digest
SHA256 868164d85c0b9c6268d53ce4a7d773365f12b55b696a18c1bdd1d301a884cec2
MD5 a1658b95d23b251f574725982378da0d
BLAKE2b-256 c6af09fe20bcb9c94a7c88e671e979cc2cdf689e226f19f78ae435d7fa459c5f

See more details on using hashes here.

File details

Details for the file ConcurrentImageRead-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for ConcurrentImageRead-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 26634a70a5e39705bdba09e1bc7ad050e8ca4f346edcd55cb103856ae98e9c2c
MD5 a8450e46e597d0b45a7bfd333900a7c3
BLAKE2b-256 63e25522b388e2dbb5a12667a4433dd4d2718870e048f58a420217243478e4c9

See more details on using hashes here.

Supported by

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