Saravanan666/pypi-org huggingface dataset:
Package: visual-center
Visual-CenterAliases: polyLabel, pole-of-inaccessibility, largest inscribed circlePython 3.10 >=pip install visual-centerCalculates the pole of inaccessibility of a polygon with optimizations based off of'A new algorithm for finding a visual center of a polygon'This is a port ofPolylabelIf this package doesn't suit your needs, there is an alternative port here:Twista/python-polylabelThis package was created with a personal goal of learning more about quadtrees. I wasn't planning on duplicating a port for the public. But now that we're here, I'm packaging this up for pip. Maybe others will find it useful.What is a 'Visual Center'?The visual center is the point in a polygon that is furthest from the polygon's edge. For basic shapes, the centroid is usually this point, but for more complex shapes this isn't always the case.For example, the centroid (Blue dot) of this polygon lands outside of it. The visual center (Red dot) is the point that is furthest from the polygon's edge.Usageimportvisual_centerpolygon=[[0,0],[0,100],[100,100],[100,0]]pole,distance=visual_center.find_pole(polygon)Pole is a tuple of the x and y coordinates of the visual center (Named after thepole-of-inaccessibility)Distance is the distance from the visual center to the polygon's edgeExamples (Red dot is the pole. Red circle is the distance):With a holeThis is especially useful for polygons with holes.importvisual_centerpolygon=[[0,0],[0,100],[100,100],[100,0]]holes=[[[50,10],[50,90],[90,90],[90,10]],[[10,10],[10,30],[40,30],[40,10]]]pole,distance=visual_center.find_pole(polygon,holes)First param is the outer shell polygon. Second param is a list of holes.Example with holes:How does it work?I highly suggest reading the original article:'A new algorithm for finding a visual center of a polygon'tl;dr: Uses quadtree partitioning to recursively subdivide the polygon into smaller cells, probing the centers of these cells as candidates and discarding cells that cannot possibly contain a better solution.Here's some fun visualizations of the algorithm in action:
Package: visualchatgpt
Visual ChatGPTVisual ChatGPTconnects ChatGPT and a series of Visual Foundation Models to enablesendingandreceivingimages during chatting.See our paper:Visual ChatGPT: Talking, Drawing and Editing with Visual Foundation ModelsDemoSystem ArchitectureQuick Start# create a new environment
conda create -n visgpt python=3.8

# activate the new environment
conda activate visgpt

#  prepare the basic environments
pip install -r requirement.txt

# download the visual foundation models
bash download.sh

# prepare your private openAI private key
export OPENAI_API_KEY={Your_Private_Openai_Key}

# create a folder to save images
mkdir ./image

# Start Visual ChatGPT !
python visual_chatgpt.pyGPU memory usageHere we list the GPU memory usage of each visual foundation model, one can modifyself.toolswith fewer visual foundation models to save your GPU memory:Foundation ModelMemory Usage (MB)ImageEditing6667ImageCaption1755T2I6677canny2image5540line2image6679hed2image6679scribble2image6679pose2image6681BLIPVQA2709seg2image5540depth2image6677normal2image3974InstructPix2Pix2795AcknowledgementWe appreciate the open source of the following projects:Hugging FaceLangChainStable DiffusionControlNetInstructPix2PixCLIPSegBLIP
Package: visual-clutter
visual-clutterPython Implementation of two measures of visual clutter (Feature Congestion and Subband Entropy),Matlab Version,+ library dependency.Pre-requisitesThis utility is written in Python 3. You will need a Python 3 interpreter installed or you will have to package this into a self contained executable.This utility usesPyrtools. So you will need to run it on Linux or on OSX. Windows is NOT supported because of issues with the C compiler (gcc isn't necessarily installed).How to Install visual_clutterpip install visual-clutter# install from git
pip install git+https://github.com/kargaranamir/visual-clutterHow to use (Examples)from visual_clutter import Vlc

# make visual clutter object and load test map and set parameters
clt = Vlc('./tests/test.jpg', numlevels=3, contrast_filt_sigma=1, contrast_pool_sigma=3, color_pool_sigma=3)

# get Feature Congestion clutter of a test map:
clutter_scalar_fc, clutter_map_fc = clt.getClutter_FC(p=1, pix=1)

# get Subband Entropy clutter of the test map:
clutter_scalar_se = clt.getClutter_SE(wlevels=3, wght_chrom=0.0625)

print(f'clutter_scalar_fc: {clutter_scalar_fc}')
print(f'clutter_scalar_se: {clutter_scalar_se}')

# just compute and display color clutter map(s)
color_clutter = clt.colorClutter(color_pix=1)

# just compute and display contrast clutter map(s)
contrast_clutter = clt.contrastClutter(contrast_pix=1)

# just compute and display orientation clutter map(s)
orientation_clutter = clt.orientationClutter(orient_pix=1)ReferenceRuth Rosenholtz, Yuanzhen Li, and Lisa Nakano. "Measuring Visual Clutter". 
Journal of Vision, 7(2), 2007. http://www.journalofvision.com/7/2/

Ruth Rosenholtz, Yuanzhen Li, and Lisa Nakano, May 2007.Citationvisual_clutter python package is now part ofAIM2. If you use any part of this library in your research, please cite it using the following BibTex entry. Bibtex entry for AIM2 will be added once it is released.@misc{visual_clutter,
  author = {Kargaran, Amir Hossein},
  title = {Visual Clutter Python Library},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub Repository},
  howpublished = {\url{https://github.com/kargaranamir/visual-clutter}},
}Related RepositoriesPiranhasAalto Interface Metrics (AIM)pyrtools: tools for multi-scale image processingStudies Referencing Our PackageMaster Thesis: Unveiling the Inner Structures of the Montreux Jazz Festival Concert
Package: visual-compare
Visual CompareInstallationpip install visual-compareExamplesCompare imagesfromvisual_compare.doc.visualimportVisualdefget_path(filename):image_base='../../files/images/'returnimage_base+filenamereference_image=get_path('123.png')test_image=get_path('124.png')vt=Visual()is_diff,res=vt.compare_images(reference_image,test_image)print(res)assertis_diffisTrueResult as followsCompare images with maskfromvisual_compare.doc.visualimportVisualdefget_path(filename):image_base='../../files/images/'returnimage_base+filenamereference_image=get_path('123.png')test_image=get_path('124.png')mask_images=[get_path('000.png')]vt=Visual()mask=vt.generate_mask(reference_image,mask_images)is_diff,res=vt.compare_images(reference_image,test_image,mask=mask)print(res)assertis_diffisTrueResult as followsCompare images with OCRfromvisual_compare.doc.visualimportVisualdefget_path(filename):image_base='../../files/images/'returnimage_base+filenamereference_image=get_path('123.png')test_image=get_path('124.png')vt=Visual()is_diff,res=vt.compare_images(reference_image,test_image,force_ocr=True,lang=['ch_sim','en'])print(res)assertis_diffisTrueResult as follows
Package: visualdiff
Featuring Puppeteer, headless Chrome and Python image diffingInstallationpipinstallvisualdiffUsageCreate your tests callingvisualdiff.compare(url), this will drive a
headless Chrome session rendering the desired URL and comparing the
resulting image with an expected one.The expectation are stored by default in avisualdiffsubfolder of
the current calling test script.There are several additional options you can use, we’ll see them in the
examplesExamplesimportvisualdiffasvdassertnotvd.difference('https://example.com')Credits:It is a long time that I wanted a tool like this one, but thanks tothis article from Monica
Dinculescufor
finally convincing me.Thanks to Mijakogi forthe outstanding work on
PyppeteerHistory0.3.0 (2018-05-12)Disable CSS animation, allow screenshot delayIf save_differences==True the diff file will contain an highlighted diff-rect0.2.3 (2018-04-11)First version in Continuous Integration0.2.0 (2018-04-06)Beta version, things should work0.1.0 (2018-02-18)First release on PyPI.
Package: visual-excel
Visual ExcelFeaturesTODORequirementsTODOInstallationYou can installVisual ExcelviapipfromPyPI:$pipinstallvisual-excelUsagePlease see theCommand-line Referencefor details.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,Visual Excelis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz'sHypermodern Python Cookiecuttertemplate.
Package: visualfailureanalysis
PurposeThis toolkit is designed to analyse the underlying representation of a image classification network.InstructionsCreate a new fodlerCreate a new virtual environmentUpdate your pipInstall the package (pip install  pip install visualfailureanalysis)Setup your folder in the form "../experiemnt_group_name/experiment_name/test_results"In this folder place your data as raw_outputs.npzFormat: Outputs of the softmax in the first columns followed by the label as an integer and dataset integer index in the last column. Each row is one data point. If you only have one data set the index is always 0.In this folder place your latent space as encoded_output.npzFormat: Outputs of the penultimate layer (e.g. inputs to the final layer) in the first columns and dataset index in the last. Each row is one data point.In this folder place your data as attribution.csvattributions.csv needs to at least contain a column called "filepath" containing the absolute filepaths of your images. If you have multiple data sets attributions are renamed to "attributions0.csv","attributions1.csv",..All three data files need the rows to be in the same order!In python: from visualfailureanalysis import analyserInitalize the main class: my_data_visulizer = analyser.Analyser(path=path,class2name=class2name,class2plot=class2plot,ls_testsets=ls_testsets,test_datasets=test_datasets)path ="../experiemnt_group_name/experiment_name"class2plot = dict({0:"myclassname0",...}) conatianing a mapping of integer classes to real namesls_testsets = ["nameoftestset",...] a list with names of all testsetsclass2plot and test_datasets are two lists with a subset of classes/ testset names for which to generate outputs. (output can be quite large)run my_data_visulizer.setup() to link the create the lower dimensional representation neededgenerate outputs and statistics with the respective class methods.OutputsGenerates outputs for representative images based on a k-means clustering of the latent space. Latennt space dimenstions are reduced to 50 by pca and 3 by T-SNE.Generates the most overconfident as well as underconfident images based on the softmax response (could be adjusted to other confidence score).
The app.py file can be run by "python3 app.py" and starts an interactive dash app that allows the user to explore the latent space of his neural network and the images linked to each data point. The data necessary to run the app can be generated by the package. After initalizing the main analyser simply run analyzer.prepaire_dash() and the correct data frame is written.
Package: visual-hash
A visual hash is an image that is generated from a large string, just
as an ordinary cryptographic hash is usually represented as a
hexadecimal string.  The advantage of a visual hash is that it is
easier for humans to remember and compare.What makes a hash good enough?A good visual hash should have the following properties:A high information content, as measured by its Shannon entropy.
This results in a hash that has a low chance of collision.  This
provides pre-image resistance, i.e. it makes it difficult to create
a second input that results in a hash identical to a given hash.A high minimum self-information.  i.e. the lowest self-information
value should be as high as possible.  This property implies the
former property, but is itself distinct.  The lowest
self-information output is most prone to collisions.  Testing for
this property is challenging, more challenging than the mean
information content discussed previously.A second-best for this property would be to be able to identify
hashes that have low self-information.  Of course, if we can
reliably identify them, we could (in principle) eliminate them
entirely by checking for a low self-information during the hashing
process, and trying again when this is encountered.Second pre-image resistance, which means that knowing the hash
input, we should not be able to produce a similar (or identical)
hash.  We achieve this by using a cryptographic hash as input to
our visual hashes, which ensures the second pre-image resistance is
identical to the first pre-image resistance.In order to generate testable visual hashes, we actually aim for
raw algorithms thatlacksecond pre-image resistance (which we
then add on via the cryptographic hash).  This allows us to more
readily explore “similar” images in order to estimate the
information content in the visual hash, and thus its first
pre-image resistance.
Package: visualife
VisuaLife : scientific visualization in a browser!VisuaLive is an interactive visualization library that allows quickly display your data in a web browser.
This unique approach allows you to use Python to quickly add interactivity to the data. The library can be used
for general plotting, however it's aim is to display biological data: sequences and structures of proteins and DNA
as well as their interactions, annotations etc.Documentation fot this project is hosted onRead the Docs.
It provides agallery of examples,tutorialsand API reference.In doc_examples/svg_examples you will find examples that produces SVG output.
In order to run the examples that are distributed with the repository in the doc_examples/html_examples folder,
use any HTTP server, e.g. the one which comes with your Python installation:python3 -m http.server
Package: visualime
VisuaLIMEVisuaLIMEis an implementation ofLIME(Local Interpretable Model-Agnostic Explanations) [1]
focused on producing visual local explanations for image classifiers.In contrast to thereference implementation,VisuaLIMEexclusively supports image classification and gives its users full control over the
properties of the generated explanations.
It was written to produce stable, reliable, and expressive explanations at scale.VisuaLIMEwas created as part of theXAI Demonstrator project.A full documentation is available onvisualime.readthedocs.io.Getting Started💡If you're new toLIME,you might want to check out theGrokking LIMEtalk/tutorial for a general introduction prior to diving intoVisuaLIME.To installVisuaLIME, run:pipinstallvisualimeVisuaLIMEprovides two functions that package its building blocks into a reference explanation
pipeline:importnumpyasnpfromvisualime.explainimportexplain_classification,render_explanationimage=...# a numpy array of shape (width, height, 3) representing an RGB imagedefpredict_fn(images:np.ndarray)->np.ndarray:# a function that takes a numpy array of shape (num_of_samples, width, height, 3)# representing num_of_samples RGB images and returns a numpy array of# shape (num_of_samples, num_of_classes) where each entry corresponds to the# classifiers output for the respective imagepredictions=...returnpredictionssegment_mask,segment_weights=explain_classification(image,predict_fn)explanation=render_explanation(image,segment_mask,segment_weights,positive="green",negative="red",coverage=0.2,)For a full example, seethe example notebook on GitHub.References[1] Ribeiro et al.:"Why Should I Trust You?": Explaining the Predictions of Any Classifier(arXiv:1602.04938, 2016)
Package: visualimiss
visualimiss"visualizemissing data". A simplemissingnoclone. Some features were removed from the original and some were added.FeaturesSome features differ from the original one:Havematrix(),bar()modified function from the original oneSimpler and fasterMaybe more readable?Installationpip install visualimissThis also install all dependencies:Numpy,Pandas,MatplotlibQuickstartThis quickstart uses datasets of theNYPD Motor Vehicle Collisions Dataset.importpandasaspddf=pd.read_csv("https://raw.githubusercontent.com/ResidentMario/missingno-data/master/nyc_collision_factors.csv")matrixvisualimiss.matrix(df)barvisualimiss.bar(df)infovisualimiss.info(df)- DataFrame has 7303 rows, 26 columns
- Memory usage: 1.519152 MB
                               Null count    Dtype
DATE                                    0   object
TIME                                    0   object
BOROUGH                               383   object
ZIP CODE                              384  float64
LATITUDE                                0  float64
LONGITUDE                               0  float64
LOCATION                                0   object
ON STREET NAME                       1065   object
CROSS STREET NAME                    1137   object
OFF STREET NAME                      6542   object
NUMBER OF PERSONS INJURED               0    int64
NUMBER OF PERSONS KILLED                0    int64
NUMBER OF PEDESTRIANS INJURED           0    int64
NUMBER OF PEDESTRIANS KILLED            0    int64
NUMBER OF CYCLISTS INJURED           7303  float64
NUMBER OF CYCLISTS KILLED            7303  float64
CONTRIBUTING FACTOR VEHICLE 1           0   object
CONTRIBUTING FACTOR VEHICLE 2        1085   object
CONTRIBUTING FACTOR VEHICLE 3        7000   object
CONTRIBUTING FACTOR VEHICLE 4        7244   object
CONTRIBUTING FACTOR VEHICLE 5        7289   object
VEHICLE TYPE CODE 1                    58   object
VEHICLE TYPE CODE 2                  1520   object
VEHICLE TYPE CODE 3                  7019   object
VEHICLE TYPE CODE 4                  7249   object
VEHICLE TYPE CODE 5                  7291   objectConfigurationSortingvisualimiss.matrix(df,sort='asc')Rotate, hide label# visualimiss.matrix(df, label_rotation=90)visualimiss.matrix(df,show_label=False)Change color, font sizevisualimiss.matrix(df,color=(43,102,189),fontsize=16)
Package: visualise-spacy-pattern
Visualise spacy patternInstallationpipinstallvisualise-spacy-patternUsageimportvisualise_spacy_pattern# Load the example dependency patternpattern_file='examples/pattern_1.json'withopen(pattern_file)asf:pattern=json.load(f)graph=visualise_spacy_pattern.to_pydot(pattern)png=graph.create_png()graph_file='examples/graph_1.png'.format()withopen(graph_file,'wb')asf:f.write(png)
Package: visualise-spacy-tree
visualise-spacy-treeAn alternative toSpaCy'svisualizer, built onGraphViz.PrerequisitesYou needGraphVizinstalled.InstallationWith pip:pipinstallvisualise-spacy-treeOr from source:gitclonehttps://github.com/cyclecycle/visualise-spacy-tree.gitvisualise_spacy_treecdvisualise_spacy_tree
pythonsetup.pyinstallUsage# Parse a string to create SpaCy Doc objectimporten_core_web_smtext='Forging involves the shaping of metal using localized compressive forces.'nlp=en_core_web_sm.load()doc=nlp(text)# Create the plotimportvisualise_spacy_treepng=visualise_spacy_tree.create_png(doc)# Write it to a filewithopen('parse_tree.png','wb')asf:f.write(png)# If you're using Jupyter notebook, you can render it inlinefromIPython.displayimportImage,displaydisplay(Image(png))# Override node attributes to customise the plotfromspacy.tokensimportTokenToken.set_extension('plot',default={})# Create a token underscore extensionfortokenindoc:node_label='{0}[{1}])'.format(token.orth_,token.i)token._.plot['label']=node_labeliftoken.dep_=='ROOT':token._.plot['color']='green''''You can set any valid GraphViz dot attribute in 'plot'.See GraphViz docs for reference of possible node attributes:https://graphviz.gitlab.io/_pages/doc/info/attrs.html'''Running the testsRunpytestfrom the root directory.AcknowledgementsUses:pydotContributionsAre welcome :)
Package: visualise-spacy-tree-0.0.1
visualise-spacy-treeAn alternative toSpaCy'svisualizer, built onGraphViz.PrerequisitesYou needGraphVizinstalled.InstallationWith pip:pipinstallvisualise-spacy-treeOr from source:gitclonehttps://github.com/cyclecycle/visualise-spacy-tree.gitvisualise_spacy_treecdvisualise_spacy_tree
pythonsetup.pyinstallUsage# Parse a string to create SpaCy Doc objectimporten_core_web_smtext='Forging involves the shaping of metal using localized compressive forces.'nlp=en_core_web_sm.load()doc=nlp(text)# Create the plotimportvisualise_spacy_treeplot=visualise_spacy_tree.plot(doc)# Write it to a file (it's png format)withopen('parse_tree.png','wb')asf:f.write(plot)# If you're using Jupyter notebook, you can render it inlinefromIPython.displayimportImage,displaydisplay(Image(plot))# Override node attributes like sofromspacy.tokensimportTokenToken.set_extension('plot',default={})# Create a token underscore extensionfortokenindoc:node_text='{0}[{1}])'.format(token.orth_,token.i)token._.plot['text']=node_textiftoken.dep_=='ROOT':token._.plot['color']='green''''You can set any valid GraphViz dot attribute in 'plot'.See GraphViz docs for reference of possible node attributes:https://graphviz.gitlab.io/_pages/doc/info/attrs.html'''Running the testspytestAcknowledgementsUses:pydotContributionsAre welcome :)
Package: visualist
This is a very simple library to visualize lists in Python.It was created mainly to support the creation of tutorials forNeps Academy(amazing website :D).Installpip install visualistUsageThe minimal example is shown below. It supposes that we want to create an image from the list [1, 2, -4, 2, -2, 5] and highlight the indexes [2, 4].fromvisualistimportVisualistvisualist=Visualist()img=visualist.img_from_list([1,2,-4,2,-2,5],highlight_indexes=[2,4])img.show()The result of this code would beIf you want to save the image changeimg.show()toimg.save('my_dear_list.png').If you use the methodimg_from_listsit will work with a list of lists. Note that thehighlightsalso need to be a list of lists.fromvisualistimportVisualistvisualist=Visualist()img=visualist.img_from_lists([[1,2,-4,2,-2,5],[1,2,3,4]],highlight_indexes=[[2,4],[1]])img.show()The result will beBuilding the libraryTo build the library you need thewheelmodule:pip install wheeland run the following command:python setup.py sdist bdist_wheelTo upload a new version use (don't forget to update the version number insetup.py):twine upload dist/*
Package: visualize3d
Visualize3DA small library to help with 3d visualizing (pointclouds).Getting StartedPlease make sure you have pytorch installed properly as a first step.pipinstallvisualize3dUsageIn your code you can create visualizations:importnumpyasnpimportvisualize3dasv3d# First create a list of geometries to show.N=42geometries=[# Pointcloud (N, 3)v3d.create_pointcloud_from_numpy(pointcloud=np.random.rand(N,3),),# Add random lines (e.g. for a box or trajectory)v3d.create_lines_from_numpy(points=np.random.rand(N,3),lines=np.array([i,i+1]foriinrange(N-1)),),# Add the origin arrows (X=red, Y=green, Z=blue).v3d.create_origin()]# Save visualization to disk (usefull in remote work or when batch processing)v3d.save("output.v3d.npy",geometries)# or show directly (if you work locally or interactive)v3d.show(geometries)To show a visualization that was saved to disk, you can write your own code or simply use thevisualize3dcommandline tool.# Show visualization from abovevisualize3d/path/to/output.v3d.npy# Show a pcd file directlyvisualize3d/path/to/filename.pcd# Show all supported files in a folder after anothervisualize3d/path/to/folderContributingCurrently there are no guidelines on how to contribute, so the best thing you can do is open up an issue and get in contact that way.
In the issue we can discuss how you can implement your new feature or how to fix that nasty bug.To contribute, please fork the repositroy on github, then clone your fork. Make your changes and submit a merge request.LicenseThis repository is under MIT License. Please see thefull license here.