Saravanan666/pypi-org huggingface dataset:
Package: image2base64
Library for converting RGB / Grayscale numpy images from to base64 and back.Installationpipinstall-Uimage_to_base_64ConversionTakesnumpy.arrayorPIL.Imageas inputRGB to base 64base64=rgb2base64(rgb_image,image_format)where image format isJPEG,PNGGrayscale to base 64base64=grayscale2base64(grayscale_image)Base64 to RGB imageoutput_type="cv2"# or "PIL"rgb_image=base64_to_rgb(base64,output_type)Base64 to Grayscale imageoutput_type="cv2"# or "PIL"grayscale_image=base64_to_grayscale(base64,output_type)IssuesFor some reason I cannot convertRGBimage toJPEGrepresentation in base 64 and back without losses.
=> test only forPNGand notJPEG
Package: image2char
image2charimage2chardescriptionconsole toolinstallinput args and get charshelpcodedescriptionthis module can change image to char[], can be printed at console beautifuleffect:-->-->this QR Code can even be recognized when density>=0.6console toolright click the title bar of cmd, and choose properties, then you can change the size of the fonts in order to fully show the char imageinstallpipinstallimage2char
or
pip3installimage2charinput args and get charsimagetochar-h

imagetocharinput1.jpgimagetocharinput2.png-d0.6-r-s1-c"█　"//thisisQRCode

imagetochar-u"https://raw.githubusercontent.com/cpak00/image2char/master/input1.jpg"-d0.7-w300-r//thisisUrlImagehelpusage: imagetochar.py [-h] [-d DENTISY] [-s SCALE] [-r] [-c CHARSET] [-u]
                     [-w WIDTH]
                     image

welcome to imagetochar cmd tool 你可以使用这个工具将本地/网络的图片转成字符画

positional arguments:
  image

optional arguments:
  -h, --help            show this help message and exit
  -d DENTISY, --dentisy DENTISY
                        dentisy, 分辨率, 取值0-1 默认为0.5
  -s SCALE, --scale SCALE
                        scale, 字符集高宽比, 默认为2
  -r, --reversed        reversed, 是否翻转黑白
  -c CHARSET, --charset CHARSET
                        charset, 字符集, 默认使用经典ascii字符集
  -u, --url             是否使用url, 将image_path路径设定为url
  -w WIDTH, --width WIDTH
                        改变图片的初始宽度codefromimage2charimporttoolfromPILimportImageimportloggingimg_path1='image2char/input1.jpg'img_path2='image2char/input2.png'if__name__=='__main__':logging.basicConfig(level=logging.DEBUG)img1=Image.open(img_path1)img2=Image.open(img_path2)matrix=tool.to_chars(img1,density=0.5,scale=2,reversed=True)logging.info('matrix:%d,%d'%(len(matrix),len(matrix[0])))foriinrange(len(matrix)):print(''.join(matrix[i]))char_list='''█　'''scanner=tool.get_scanner(density=0.6,scale=1)# reversed=True: in windows console, the char is whitescanner.scan(img2,reversed=True,char_list=char_list)scanner.print_result()
Package: image2excel
Documentation for image2excelThis library recieves as inputs an image and outputs an Excel file (.xlsx) where each cell will be a pixel of the image.it is recommended to import the package in the following way:from image2excel import im2xlsxThe function has two parameters, resize (True is default) and keep_aspect (False is default), as shown by the following example:im2xlsx(file,resize=True,keepAspect=False)The function has no returnThe file parameter should contain a path, otherwise path where the script is running is taken as default path. The input path will be used for the output path as well.The resize parameter will only work to reduce the image, in case the image is already smaller in both dimensions than the recommended 260 x 300, no resizing will take placethe parameter keep aspect, as it is relatively clear, will keep the ratio between width and height of the imageThis package and documentation are in the first version and it is also my first package in PYPI, so in case you have any sort of recommendations, please let me know =))Also if you know how to make the code more performant or robust, I will also be happy with improving this
Package: image2gps
image2gpsExtract time and coords from image 🖼📍⏱️Image sourcefromimage2gpsimportimage2gpstime,coords=image2gps('demo.jpg')print(f'Image taken in{coords}at{time}')# >>> Image taken in (43.467, 11.885) at 2008-11-01 21:15:07This sample can be foundhereInstallationpipinstallimage2gpsTestspython-mpytesttests# or only certain testspython-mpytesttests/test_main.py
python-mpytesttests/test_time.pyMorePyPI:https://pypi.org/project/image2gpsRepository:https://github.com/abionics/image2gpsDeveloper: Alex Ermolaev (Abionics)Email:abionics.dev@gmail.comLicense: MIT (see LICENSE.txt)
Package: image2html
image2htmlFor quick viewing images via html file.InstallYou can install it from pip or source code.pippipinstallimage2htmlsource codegitclonehttps://github.com/ZQPei/image2html.gitcdimage2html
pythonsetup.pyinstall# use sudo if necessaryUsagemake flist# Get all the path of images in dir and save them to output file.make_flist[dir][output]--keywordkeyword1,keyword2--ext('.png','.jpg')--recursive# for examplemake_flistdemo_img_folder1img_flist1.txt--keywordcmpcmp--ext('.png','.jpg')image2html# Display all the images with specified extension in demo/iimg_folder1.image2html--dirsdemo/img_folder1--outputdemo/demo_single.html# Note that if there are multiple dirs, the number of images shall be equal in each directory.image2html--dirsdemo/img_folder1demo/img_floder2--outputdemo/demo_multiple.html# Then you will get demo_single.html and demo_multiple.html in demo folder.Use a http server to view html file on browser.# First build a http serverbuild_server--port8000# Then open your browser with address http://your_ip_address:8000/home/pzq/github/image2html/demo/demo_multiple.html.Example
Package: image2layout-computer-vision
image2layout_computer_visionAn image processing module for some computer vision tasks (public module for image2layout)Package Page:pypiFeatures:Text Detection and Recognition (OCR)Color extraction (background and main foreground)InstallationsInstall withpython/conda[Linux](Optional) Condacurlhttps://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh-o~/conda.sh
bash~/conda.sh-b-f-p/opt/conda
rm~/conda.sh
condainit--all--dry-run--verbose

condacreate-ncvpython=3.10-y
condaactivatecvPython libraries (python>=3.8)CPUpython-mpipinstalltorchtorchvisiontorchaudio--index-urlhttps://download.pytorch.org/whl/cpu
python-mpipinstallpaddleocrpaddlepaddle

python-mpipinstalldatasetstransformersscikit-learnPillownumpypandaschardet
python-mpipinstall--upgradeimage2layout-computer-visionGPU# python -m pip install 'torch>=2.0' torchvision torchaudiocondainstallpytorchtorchvisiontorchaudiopytorch-cuda=11.8-cpytorch-cnvidia-y
python-mpipinstallpaddleocrpaddlepaddle-gpu

python-mpipinstalldatasetstransformersscikit-learnPillownumpypandaschardet
python-mpipinstall--upgradeimage2layout-computer-visionInstall withdockerFor running with CPU on Ubuntusudodockerbuild--tagcv-fDockerfile_cpu.

sudodockerrun-it-p0.0.0.0:8000:8000-p0.0.0.0:8001:8001-v$(pwd):/appcvbashFrom inside containercddeployment
condaactivatecv
pythonapi_serve.py-nCV-p8000from gitpython-mpipinstallgit+https://github.com/felix-do-wizardry/image2layout-computer-vision.gitUsageNote: Input image/images expects a filepath, an Image.Image object, or a numpy arrayRun this python code to pre-download model weightsfromimage2layout_computer_visionimportOCROCR._load()Recognize textsfromimage2layout_computer_vision.ocrasOCR# [A] no text, box only, 2 lists of dicts with keys [text (empty), box, score (empty)]data_merged,data_raw=OCR.detect_text_data('path/to/image.png',recognition=False)# [B] text + box from multiple images -> list of list of dicts with keys [text, box, score]data_raw_multi=OCR.detect_text_elements(['path/to/image.png','path/to/image2.png'])Extract colorsimportimage2layout_computer_visionasicv# [A] list [ tuples [ 2 rgb-color tuples ] ] for background and foreground# sample output: [((2, 2, 2), (4, 4, 4)), ((6, 6, 6), (8, 8, 8))]colors_all=icv.extract_colors(['path/to/image.png','path/to/image2.png'])# [B] 2 rgb-color tuples for background and foreground# sample output: ((9, 9, 9), (6, 6, 6))color_bg,color_fg=icv.extract_colors('path/to/image.png')Detect elements [work-in-progress]importimage2layout_computer_vision.yolov6asDetection# pd.DataFrame with columns [box, score, class_index, class_name]df_element=Detection.detect_element('path/to/image.png')Build(for building and uploading this package)python-mpipinstall--upgradepip
python-mpipinstall--upgradebuildtwine"keyring<19.0"rm-rfdist
python-mbuild
python-mtwineuploaddist/*--verbose
Package: image2patch
image2patchimage2patchsplits the image in different patches with automatic detection of the best step in order to minimize pixels loss. The overlap between patches depends on the patch size.
Alternatively, it is possible to choose the step size.The reconstruction of the original image is possible usingpatch2imagewhich can merge the patches taking into account the overlap percentage among patches. Hence, the original image is perfectly restored.
If there is a minimum pixels loss during patching procedure, resize to its original dimensions is possible.ExampleInstallationpipinstallimage2patchfromimage2patchimportimage2patchfromimage2patchimportpatch2imageHow to use itimage2patch(image, patch_size, step=None, verbose=False)In particular:image : 2D input imagepatch_size : dimension of the windowstep : the distance from one step to another, if =None it will be automatically detected in order to avoid pixels loss. If set = patch_size it will provide patches without overlapping but with pixels loss depending on the size of the input image.verbose : if =True it provides details.patch2image(patched_image, original_dims, step, resize_flag = True)In particular:patched_image : 2D input patches from image2patchoriginal_dims : dimension of the original imagestep : step obtained fromimage2patchresize_flag : allows to resize the image to its original dimension in case of pixels loss.LicenceMIT
Package: image2pipe
WhyI need to extract decoded frames from videos in order to feed DNN pipeline.This is the answer package.Installpip install image2pipeUsagefrom multiprocessing import Queue
import logging
import cv2

import image2pipe

logging.basicConfig()


q = Queue(maxsize=4)
decoder = image2pipe.images_from_url(q, "shuttle-flip.mp4", fps="30", scale=(1000, 556))
decoder.start()

 for pair in yield_from_queue(q):
        fn, img = pair
        gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

        cv2.imshow("gray", gray)
        cv2.waitKey()
        cv2.destroyAllWindows()
Package: image2pyarray
組み合わせが必要な場合(一つの画像を入力として複数の教師信号が1になる場合)は使えませんzipなどを展開せず読めます使い方>>>fromimage2pyarrayimportImage2PyArray>>>i2pa=Image2PyArray()>>>(X_train,Y_train),(X_test,Y_test)=i2pa.from_dir("/path/to/dir");>>>(X_train,Y_train),(X_test,Y_test)=i2pa.from_zip("/path/to/file.zip");...Treetrain, testは両方必要classname_1, 1.jpgなどは特に名前に制限なしtrain, test 以下のディレクトリ名は全て一致する必要があるzipでも同様に、zipのルート直下にtrain, testが両方必要dirname
 |
 |-train
 |  |
 |  |-classname_1
 |  |  |
 |  |  |-1.jpg
 |  |  |-2.jpg
 |  |  :
 |  |  `-l.jpg
 |  |
 |  |-classname_2
 |  |  |
 |  |  |-1.jpg
 |  |  |-2.jpg
 |  |  :
 |  |  `-m.jpg
 |  :
 |  `-classname_k
 |     |
 |     |-1.jpg
 |     |-2.jpg
 |     :
 |     `-n.jpg
 |
 `-test
    |
    |-classname_1
    |  |
    |  |-1.jpg
    |  |-2.jpg
    |  :
    |  `-p.jpg
    |
    |-classname_2
    |  |
    |  |-1.jpg
    |  |-2.jpg
    |  :
    |  `-q.jpg
    :
    `-classname_k
       |
       |-1.jpg
       |-2.jpg
       :
       `-r.jpg機能directoryzip(HTTP)(tar)
Package: image2sound
image2soundimage2soundis a utility that accepts an image file, converts the RGB values of each pixel to a frequency, and saves the result to three separate WAV files.NOTE: Large image files no longer automatically result in large audio files as the user can specify a target track length and sane defaults are applied when this is not specified.RequirementsPILnumpywavioargparsemathTo runSimply runningpython3 main.pywill generate audio using the test image and default settings.ArgumentsThe following optional arguments may be set, however:-pfor a path to an image-keyfor musical key (defaults to C )-tfor tempo (defaults to 60 bpm)-minfor the desired number of minutes (defaults to 1 so must be set to zero if shorter tracks are wanted)-secfor the desired number of seconds (defaults to zero)"Split" modeNote that the default behavior of the utility is to create a single stereo audio file.
Adding--splitwill split the resulting audio into three separate files (red, green, blue)."Reveal" modeAdding--revealwill override the key, tempo, and minutes/seconds with data derived from the image itself, "revealing" the music within the image as it were,Example 1:python3 main.py -p image.png -key Dminor -t 80 -min 11 -sec 38Example 2:python3 main.py -p image.png -key Dminor -t 80 -min 11 -sec 38 --splitExample 3:python3 main.py -p image.png --reveal
Package: image3c
Instructions for training and predictionInstallation of pythonFor best performance an NVIDIA GPU with CUDA is recommendedInstall requirements for TensorFlowtensorflow_gpu-1.15.0	3.3-3.7NVIDIA driversLinux : >= 410.48Windows : >= 411.31cuDNN 7.6 (See below to install with conda)CUDA 10.2 (See below to install with conda)The stepsbelowinstall the CUDA libraries during the conda environment setup,
but if you want more information about it see these links:For more detail about using conda to install CUDA see this article:Install CUDA with condaFor more information regarding installation of CUDA, see this document:NVIDIA CUDAInstall miniconda (recommended) or anacondaWe recommend usingcondaas an environment and package manager. It will allow easily creating python
environments with specific version and package needs. If you already have Anaconda
installed it will work and the instructions below will be the same.Downloadminicondafor your platform.Follow the installation documentation for the target operating system:WindowsLinuxMacAfter installation, open a terminal to start installing packages. On Windows find the
Anaconda Prompt command using the search tool.Create a conda environmentImage3c requires version 3.7 of python and TensorFlow version 1.15, so a fresh conda
enviroment is recommended. We have written an environment file the takes care of
creating the conda environment and installing all needed dependencies. If you are on
MacOS or don't have an NVIDA GPU with CUDA use environment.yml. If you are on Windows
or Linux and have a CUDA GPU then use environment_gpu.ymlCreating the conda environment in this way also installs the correct CUDA
libraries in the conda python environment.In the following command, a conda environment
namedimage3cis created with python 3.7:conda env create -f environment.ymlif on windows or linux with a CUDA gpuconda env create -f environment_gpu.ymlTo activate this environment, use this command:conda activate image3cThe image3c python package is installed during the creation of the conda
environment, so no other installation command are needed.Install image3c from pipIf you don't want to create an environment as described above, image3c can
be installed with pip:pip install image3cHow to use Image3cThe main documentation can be found at:Image3c GithubJupyter notebooks giving details about training and predicting
data from the ImageStream can be found in the main pages of this github repository:Classifier Notebooks.
Package: image-analysis-util
image-analysis-utilCopyright (c) UChicago Argonne, LLC. All rights reserved.Scientific image exploration software for 2D, 3D, and 4D datasets. A continuation of the Image_Analysis repository.AboutThe image-analysis-util repository focuses on providing tools for users to explore and analyze their datasets. In constrast to Image_Analysis, the ultimate goal of image-analysis-util is to provide a generalized set of analysis features.Built Withh5pyPyQt5pyqtgraphxarrayGetting StartedPrerequisitesPython 3.7+Anaconda 3InstallationPyPI Installationpip install image-analysis-utilConda InstallationClone the repositiory.git clone https://github.com/henryjsmith12/image-analysis-util.gitCreate an Anaconda virtual environment usingenvironment.yml. The environment name can be altered in that file. By default, the virtual environment is namedia-util-venv.conda env create -f environment.ymlActivate the virtual environment.conda activate ia-util-venvScreenshotsRoadmapTutorial files for file creation/ImageToolFile Exportation - The ideal goal will be to have exporting options for xarray DataArray objects, .iau files, and matplotlib plots.Performance improvements for slicingExtensive testingPixel averaging (ROIs/Binning)LicenseSeeLICENSE.txtfor more information.AuthorHenry Smith- Co-op Student Technical at Argonne National LaboratorySupportReport bugs hereEmail author atsmithh@anl.gov
Package: image-analyst
ImageAnalystImageAnalyst is a library that simplifies image analysis. The library achieves this goal by standardizing the input and output
vectors of a few machine learning models and by providing some high-level analysis algorithms.RequirementsThe application requires:Python~= 3.9pipExtrasThe application has some extras that can be installed:cv2hftfonnxDownload & InstallationThere is two ways to download and install the application.Using PyPIYou can download and install the application usingPyPI. To do so, run the following command:pipinstallimage-analystUsing the GitHub releasesYou can download the application on thedownloads page. Then, you can install the application by running the following command:pipinstallimage_analyst-X.X.X-py3-none-any.whl(Note: The X.X.X must be replaced by the version that you want to install.)ExampleThis example allows you to track objects from your webcam. It requires thecv2extra.fromimage_analyst.cv2.utilsimportconvert_image,create_frame_generatorfromimage_analyst.cv2.modelsimportYoloV3OpenCVfromimage_analyst.trackersimportIOUTrackerimportcv2defreport_callback(filename:str,current_size:float,total_size:float):print("{}{:.2f}%".format(filename,current_size/total_size*100),end="\r",flush=True)model=YoloV3OpenCV.coco(report_callback=report_callback)tracking_function=IOUTracker(model)withcreate_frame_generator(0)asframe_generator:forframeinframe_generator:converted_frame=convert_image(frame,model.supported_format,model.supported_dtype)instances=tracking_function(converted_frame)forinstanceininstances:xmin,ymin,xmax,ymax=instance.bounding_box.as_tuple()text="{}{}{:.2f}".format(instance.id,instance.class_name,instance.score)cv2.rectangle(frame,(xmin,ymin),(xmax,ymax),(0,255,0),2)cv2.putText(frame,text,(xmin,ymin),cv2.FONT_HERSHEY_SIMPLEX,1,(0,255,0),2)cv2.imshow("Tracking",frame)ifcv2.waitKey(1)&0xFF==ord('q'):breakcv2.destroyAllWindows()LicenseAll code is licensed for others under a MIT license (seeLICENSE).
Package: image-analyst-cv2
ImageAnalyst CV2ImageAnalyst CV2 is an extension to theImageAnalystlibrary, providing additional models and functions usingcv2.RequirementsThe application requires:Python~= 3.9pipExtrasThe application has some extras that can be installed:cv2cv2-headlessDownload & InstallationThere is two ways to download and install the application.Using PyPIYou can download and install the application usingPyPI. To do so, run the following command:pipinstallimage-analyst-cv2Using the GitHub releasesYou can download the application on thedownloads page. Then, you can install the application by running the following command:pipinstallimage_analyst_cv2-X.X.X-py3-none-any.whl(Note: The X.X.X must be replaced by the version that you want to install.)LicenseAll code is licensed for others under a MIT license (seeLICENSE).
Package: image-analyst-hf
ImageAnalyst HFImageAnalyst HF is an extension to theImageAnalystlibrary, providing additional models and functions usinghuggingface.RequirementsThe application requires:Python>=3.9, <3.12pipDownload & InstallationThere is two ways to download and install the application.Using PyPIYou can download and install the application usingPyPI. To do so, run the following command:pipinstallimage-analyst-hfUsing the GitHub releasesYou can download the application on thedownloads page. Then, you can install the application by running the following command:pipinstallimage_analyst_hf-X.X.X-py3-none-any.whl(Note: The X.X.X must be replaced by the version that you want to install.)LicenseAll code is licensed for others under a MIT license (seeLICENSE).
Package: image-analyst-onnx
ImageAnalyst ONNXImageAnalyst ONNX is an extension to theImageAnalystlibrary, providing additional models and functions usingonnx.RequirementsThe application requires:Python~= 3.9pipDownload & InstallationThere is two ways to download and install the application.Using PyPIYou can download and install the application usingPyPI. To do so, run the following command:pipinstallimage-analyst-onnxUsing the GitHub releasesYou can download the application on thedownloads page. Then, you can install the application by running the following command:pipinstallimage_analyst_onnx-X.X.X-py3-none-any.whl(Note: The X.X.X must be replaced by the version that you want to install.)LicenseAll code is licensed for others under a MIT license (seeLICENSE).
Package: image-analyst-tf
ImageAnalyst TFImageAnalyst TF is an extension to theImageAnalystlibrary, providing additional models and functions usingtensorflow.RequirementsThe application requires:Python>=3.9, <3.12pipDownload & InstallationThere is two ways to download and install the application.Using PyPIYou can download and install the application usingPyPI. To do so, run the following command:pipinstallimage-analyst-tfUsing the GitHub releasesYou can download the application on thedownloads page. Then, you can install the application by running the following command:pipinstallimage_analyst_tf-X.X.X-py3-none-any.whl(Note: The X.X.X must be replaced by the version that you want to install.)LicenseAll code is licensed for others under a MIT license (seeLICENSE).
Package: image-app
DocumentationThe documentation is hosted athttps://github.com/BingerYang/image_appInstallationpipinstallimage_appUsage在一张图中找到连续相似的一片片长方向区域# -*- coding: utf-8 -*-importosfromimage_appimportload_smooth_areaimportcv2path=os.path.abspath("1.jpg")image=cv2.imread(path)rects=load_smooth_area(image)forrectinrects:cv2.rectangle(image,(rect[0],rect[1]),(rect[2],rect[3]),(120,78,255),2)cv2.imwrite('test.jpg',image)cv2.imshow("test",image)cv2.waitKey(3000)
Package: imageapply
Image ApplyA package for improving the simplicity of adapting Segmentation Models to large images.This package include a class that can be used to apply a segmentation model to large images. The class will split the image into smaller tiles, apply the model to each tile, and then stitch the tiles back together. This allows the model to be applied to images that are too large to fit in memory.InstallationpipinstallimageapplyUsageThis package can be used to easily extend a segmentation model to large images. The following example is for amodelthat takes a batch of images of size (None, 256, 256, 3) as input and outputs a mask of size (None, 256, 256, 1).fromimageapplyimportFlexibleModelmodel=FlexibleModel(model,input_size=(256,256,3),max_batch_size=16)# Apply the model to a batch of large images of size (20, 1024, 1024, 3)masks=model(images)
Package: image-array-and-histogram
Image array and histogramThis python package helps you to get an array and histogram of a greyscale image. You can also convert an array to greyscale image.Installation$pipinstallimage-array-and-histogramFunctionsgetImageArray(image_object): Takes an image object and returns image array. The dimensions of the array is the size of the image.getHist(image_array): Takes an image array (of pixels) and returns an array of size 256 as the histogram of the image.getImageFromArray(image_array, width, height): Takes an array, width and height and returns an image formed from the passed array. The dimensions of the image arewidth*height