Saravanan666/pypi-org huggingface dataset:
Package: torch-tweaks
torch-tweaksUtility functions for PyTorch.UsageCheck theexamplesfolder for notebooks.AppendixInstallationThetorch-tweaksgit repois available asPyPi packagepipinstalltorch-tweakspipinstallgit+ssh://git@github.com/ulf1/torch-tweaks.gitInstall a virtual environmentpython3.6-mvenv.venvsource.venv/bin/activatepip3install--upgradepippip3install-rrequirements.txtpip3install-rrequirements-dev.txtpip3install-rrequirements-demo.txt(If your git repo is stored in a folder with whitespaces, then don’t use
the subfolder.venv. Use an absolute path without whitespaces.)Python commandsJupyter for the examples:jupyter labCheck syntax:flake8--ignore=F401--exclude=$(grep-v'^#'.gitignore | xargs | sed-e's//,/g')Run Unit Tests:pytestPublishpandocREADME.md--frommarkdown--torst-s-oREADME.rstpythonsetup.pysdisttwineupload-rpypidist/*Clean upfind.-typef-name"*.pyc"|xargsrmfind.-typed-name"__pycache__"|xargsrm-rrm-r.pytest_cacherm-r.venvSupportPleaseopen an
issuefor support.ContributingPlease contribute usingGithub
Flow. Create a branch,
add commits, andopen a pull
request.
Package: torch-uncertainty
TorchUncertaintyis a package designed to help you leverage uncertainty quantification techniques and make your deep neural networks more reliable. It aims at being collaborative and including as many methods as possible, so reach out to add yours!:construction:TorchUncertaintyis in early development :construction: - expect changes, but reach out and contribute if you are interested in the project!Please raise an issue if you have any bugs or difficulties and join thediscord server.This package provides a multi-level API, including:ready-to-train baselines on research datasets, such as ImageNet and CIFARdeep learning baselines available for training on your datasetspretrained weightsfor these baselines on ImageNet and CIFAR (work in progress 🚧).layers available for use in your networksscikit-learn style post-processing methods such as Temperature ScalingSee theReference pageor theAPI referencefor a more exhaustive list of the implemented methods, datasets, metrics, etc.InstallationInstall the desired PyTorch version in your environment.
Then, install the package from PyPI:pipinstalltorch-uncertaintyIf you aim to contribute, have a look at thecontribution page.Getting Started and DocumentationPlease find the documentation attorch-uncertainty.github.io.A quickstart is available attorch-uncertainty.github.io/quickstart.Implemented methodsBaselinesTo date, the following deep learning baselines have been implemented:Deep EnsemblesMC-Dropout -TutorialBatchEnsembleMasksemblesMIMOPacked-Ensembles (seeblog post) -TutorialBayesian Neural Networks :construction: Work in progress :construction: -TutorialRegression with Beta Gaussian NLL LossDeep Evidential Classification & Regression -TutorialAugmentation methodsThe following data augmentation methods have been implemented:Mixup, MixupIO, RegMixup, WarpingMixupPost-processing methodsTo date, the following post-processing methods have been implemented:Temperature, Vector, & Matrix scaling -TutorialMonte Carlo Batch Normalization -TutorialTutorialsWe provide the following tutorials in our documentation:From a Standard Classifier to a Packed-EnsembleTraining a Bayesian Neural Network in 3 minutesImprove Top-label Calibration with Temperature ScalingDeep Evidential Regression on a Toy ExampleTraining a LeNet with Monte-Carlo DropoutTraining a LeNet with Deep Evidential ClassificationAwesome Uncertainty repositoriesYou may find a lot of papers about modern uncertainty estimation techniques on theAwesome Uncertainty in Deep Learning.Other ReferencesThis package also contains the official implementation of Packed-Ensembles.If you find the corresponding models interesting, please consider citing ourpaper:@inproceedings{laurent2023packed,
    title={Packed-Ensembles for Efficient Uncertainty Estimation},
    author={Laurent, Olivier and Lafage, Adrien and Tartaglione, Enzo and Daniel, Geoffrey and Martinez, Jean-Marc and Bursuc, Andrei and Franchi, Gianni},
    booktitle={ICLR},
    year={2023}
}
Package: torchure
TorchFun (originally Torchure)##for those who expect more convenient features from torchFunctionalityflatten(tensor)imshow(tensor_batch)loadInstall TorchFunpipinstalltorchfunAPIFlatten (Module)used to reshape outputsUsage:flat = Flatten()
out = flat(x)flatten (function)Usage:out = flatten(x)imshow (function)only deal with torch channel-first image batch,Arguements:x: input data cube, torch tensor or numpy array.title: add title to plot. (Default None)title can be string, or any string-able object.auto_close: (default True)Close the pyplot session afterwards.Clean the environment just like you had never used matplotlib here.if set to False, the plot will remain in the memory for further drawings.Usage:imshow(batch)
imshow(batch,title=[a,b,c])
imshow(batch,title='title')
imshow(batch,auto_close=False)load (function)Arguements:arbitrary arguemnts named :aandbLoad weightainto modelb, or load modelbusing weightaThe order of the arguments doesn't matter.
Example:load('weights.pts',model)or>load(model,'weights.pts')or>f = open('weight.pts')
>load(f,model)or>load(model,f)Return value:None
Package: torch-utils
torch-utilsCommon Utils for PyTorch.InstallationNeed Python 3.6+.pipinstalltorch-utilsUsageAccuracyimporttorch_utils# ...top_1,top_5=torch_utils.accuracy(output=...,target=...,top_k=(1,5))Meterimporttorch_utilsloss_meter=torch_utils.AverageMeter(name='Meter',length=10)loss_meter.update(val=...)print(loss_meter.avg,loss_meter.val)print(loss_meter)#> Test 0.00 (0.00)progress_meter=torch_utils.ProgressMeter(total_steps=100,total_epochs=10)progress_meter.update(step=10)assertprogress_meter.step==10assertprogress_meter.ratio==0.1assertprogress_meter.epoch==1print(progress_meter)#> Step 10/100=10.0% (1/10)
Package: torch-vectorized
Torch VectorizedBatched and vectorized operations on volume of 3x3 symmetric matrices with Pytorch. The current Pytorch's implementation of batch eigen-decomposition is very slow when dealing with huge number of small matrices (e.g. 500k x 3x3).This library offers some basic functions like vSymEig, vExpm and vLogm for fast computation (>250x faster) of huge number of small matrices with Pytorch using an analytical solution.Read the documentatonHEREvSymEigA quick closed-form solution for volumetric 3x3 matrices Eigen-Decomposition with Pytorch. Solves Eigen-Decomposition of data with shape Bx9xDxHxW, where B is the batch size, 9 is the flattened 3x3 symmetric matrices, D is the depth, H is the Height, W is the width. The goal is to accelerate the Eigen-Decomposition of multiple (>500k) small matrices (3x3) on GPU with Pytorch using an analytical solution.vExpmBased on vSymEig, computes the matrix exponential for batch of volumetric 3x3 matrices.vLogmBased on vSymEig, computes the matrix logarithm for batch of volumetric 3x3 matrices.Install mepip install torch-vectorizedHow to useimporttorchfromtorchvectorized.utilsimportsymfromtorchvectorized.vlinalgimportvSymEig# Random batch of volumetric 3x3 symmetric matrices of size 16x9x32x32x32input=sym(torch.rand(16,9,32,32,32))# Output eig_vals with size: 16x3x32x32x32 and eig_vecs with size 16,3,3,32,32,32eig_vals,eig_vecs=vSymEig(input,eigenvectors=True)ContributingHow to contribute ?Create a branch by feature and/or bug fixGet the codeCommit and pushCreate a pull requestBranch namingFeature branchfeature/ [Short feature description] [Issue number]Bug branchfix/ [Short fix description] [Issue number]Commits syntax:Adding code:+ Added [Short Description] [Issue Number]Deleting code:- Deleted [Short Description] [Issue Number]Modifying code:* Changed [Short Description] [Issue Number]Merging code:Y Merged [Short Description] [Issue Number]Icons made byFreepikfromwww.flaticon.comis licensed byCC 3.0 BY
Package: torchversionist
TorchVersionistTorchVersionist is a powerful Python library designed for PyTorch users to effortlessly manage model versions. It automates the tracking of model architectures, hyperparameters, and performance metrics, facilitating a smoother development and analysis process.Key FeaturesAutomated Model Versioning: Automatically assign and track versions for each of your PyTorch models.Detailed Metadata Tracking: Store and retrieve comprehensive metadata and hyperparameters for each model iteration.Performance Metrics Logging: Keep a record of model performance metrics for easy comparison and analysis.Intuitive Model Retrieval: Quickly access any version of your model with straightforward retrieval functions.InstallationpipinstallTorchVersionistUsageHere's a quick start on how to use TorchVersionist:fromtorchversionistimportModelManager# Initialize with your PyTorch modelmodel_manager=ModelManager(your_model,model_name="example_model")# After training your modelmodel_manager.save(meta_data={'training_details':'...'},metrics={'accuracy':0.95})ContributingContributions to TorchVersionist are welcome! Open an issue or submit pull requests for any improvements or bug fixes.LicenseLicensed under the MIT License.
Package: torchvggish
Torch VGGishA PyTorch port ofVGGish1,
a feature embedding frontend for audio classification models. The weights are ported directly from the tensorflow model, so embeddings created usingtorchvggishwill be identical.Quick startThere are two options: you can install the last stable version from pypi, or clone this repo and install.# optional: create virtual envcdtorchvggish&&python3-mvenv.envsourceactivate.env/bin/activate

pipinstall-ihttps://test.pypi.org/simple/torchvggish==0.1# OR get the latest versiongitclonegit@github.com:harritaylor/torchvggish.git
pipinstall-rrequirements.txtUsageBarebones example of creating embeddings from anexamplewav file:fromtorchvggishimportvggish,vggish_input# Initialise model and download weightsembedding_model=vggish()embedding_model.eval()example=vggish_input.wavfile_to_examples("example.wav")embeddings=embedding_model.forward(example)1.  S. Hershey et al., ‘CNN Architectures for Large-Scale Audio Classification’,\
    in International Conference on Acoustics, Speech and Signal Processing (ICASSP),2017\
    Available: https://arxiv.org/abs/1609.09430, https://ai.google/research/pubs/pub45611
Package: torchvideo
torchvideoAPyTorchlibrary for video-based computer vision tasks.torchvideoprovides
dataset loaders specialised for video, video frame samplers, and transformations specifically for video.Get startedSet up an accelerated environment in conda$condaenvcreate-fenvironment.yml-ntorchvideo$condaactivatetorchvideo#Thefollowingstepsaretakenfrom#https://docs.fast.ai/performance.html#installation$condauninstall-y--forcepillowpiljpeglibtiff$pipuninstall-ypillowpiljpeglibtiff$condainstall-y-cconda-forgelibjpeg-turbo$CFLAGS="${CFLAGS}-mavx2"pipinstall--upgrade--no-cache-dir--force-reinstall--no-binary:all:--compilepillow-simd$condainstall-yjpeglibtiffNOTE: If the installation ofpillow-simdfails, you can try installing GCC from
conda-forge and trying the install again:$condainstall-ygxx_linux-64
$exportCXX=x86_64-conda_cos6-linux-gnu-g++
$exportCC=x86_64-conda_cos6-linux-gnu-gcc
$CFLAGS="${CFLAGS}-mavx2"pipinstall--upgrade--no-cache-dir--force-reinstall--no-binary:all:--compilepillow-simd
$condainstall-yjpeglibtiffIf you install any new packages, check thatpillow-simdhasn't be overwritten
by an alternatepillowinstall by running:$python-c"from PIL import Image; print(Image.PILLOW_VERSION)"You should see something like6.0.0.post0Pillow doesn't release withpostsuffixes, so if you havepostin the version
name, it's likely you havepillow-simdinstalled.Install torchvideo$pipinstallgit+https://github.com/willprice/torchvideo.git@masterLearn how to usetorchvideoCheck out theexample notebooks, you can launch these on binder without
having to install anything locally!AcknowledgementsThanks to the following people and projectsyjxiongfor his work on TSN and publicly
availablepytorch implementationfrom which many of the transforms in this project started from.dukebwfor his excellentlintelFFmpeg video loading library.hypothesisand the team behind it. This
has been used heavily in testing the project.
Package: torchvideo2
torchvideoThis repo is forked from the original torchvideo repo (https://github.com/torchvideo/torchvideo),
fixing gulpio to gulpio2.APyTorchlibrary for video-based computer vision tasks.torchvideoprovides
dataset loaders specialised for video, video frame samplers, and transformations specifically for video.Get startedSet up an accelerated environment in conda$condaenvcreate-fenvironment.yml-ntorchvideo$condaactivatetorchvideo#Thefollowingstepsaretakenfrom#https://docs.fast.ai/performance.html#installation$condauninstall-y--forcepillowpiljpeglibtiff$pipuninstall-ypillowpiljpeglibtiff$condainstall-y-cconda-forgelibjpeg-turbo$CFLAGS="${CFLAGS}-mavx2"pipinstall--upgrade--no-cache-dir--force-reinstall--no-binary:all:--compilepillow-simd$condainstall-yjpeglibtiffNOTE: If the installation ofpillow-simdfails, you can try installing GCC from
conda-forge and trying the install again:$condainstall-ygxx_linux-64
$exportCXX=x86_64-conda_cos6-linux-gnu-g++
$exportCC=x86_64-conda_cos6-linux-gnu-gcc
$CFLAGS="${CFLAGS}-mavx2"pipinstall--upgrade--no-cache-dir--force-reinstall--no-binary:all:--compilepillow-simd
$condainstall-yjpeglibtiffIf you install any new packages, check thatpillow-simdhasn't be overwritten
by an alternatepillowinstall by running:$python-c"from PIL import Image; print(Image.PILLOW_VERSION)"You should see something like6.0.0.post0Pillow doesn't release withpostsuffixes, so if you havepostin the version
name, it's likely you havepillow-simdinstalled.Install torchvideo$pipinstallgit+https://github.com/willprice/torchvideo.git@masterLearn how to usetorchvideoCheck out theexample notebooks, you can launch these on binder without
having to install anything locally!AcknowledgementsThanks to the following people and projectsyjxiongfor his work on TSN and publicly
availablepytorch implementationfrom which many of the transforms in this project started from.dukebwfor his excellentlintelFFmpeg video loading library.hypothesisand the team behind it. This
has been used heavily in testing the project.
Package: torchvision4ad
torchvision for Anomaly DetectionYou can use the MVTec Anomaly Detection Dataset.Installationpip:$pipinstalltorchvision4adFrom source:$pythonsetup.pyinstallUsageYou can use one of the MVTec AD Dataset names {'bottle', 'cable', 'capsule', 'carpet', 'grid', 'hazelnut', 'leather', 'metal_nut', 'pill', 'screw', 'tile', 'toothbrush', 'transistor', 'wood', 'zipper'}.fromtorchvision4ad.datasetsimportMVTecADroot='mvtec_ad'dataset_name='bottle'mvtec_ad=MVTecAD(root,dataset_name,train=True,download=True)for(img,target)inmvtec_ad:...Of course, you can also give a function/transform takes in an PIL image and returns a transformed version.importtorchvision.transformsastransformsfromtorchvision4ad.datasetsimportMVTecADtransform=transforms.Compose([transforms.Resize([64,64]),transforms.ToTensor()])mvtec_ad=MVTecAD('mvtec_ad','bottle',train=True,transform=transform,download=True)
Package: torchvision-enhance
# torchvision-enhancetorchvision-enhance is used to enhance the offical PyTorch vision library torchvision. Here is the enhanced parts:- support multi-channel(> 4 channels, e.g. 8 channels) images- support 16-bit TIF file- more easier to semantic segmentation transform## Support transforms- RandomFlip- RandomVFlip- RandomHFlip- RandomRotate- RandomShift- RandomCrop- CenterCrop- Resize- Pad- GaussianBlur- PieceTransform- Lambda- ToTensor- Normalize## Install```pip install torchvision-enhance```or  install from the source```git clonepip install -r requirements.txtpython setup.py install```## Dependencies- numpy- scipy- Pillow- PyTorch- opencv- scikit-image## UsageFor more useage, check out the [example-classification.py](./test/example-classification.py) and [example-segmentation.py](./test/example-segmentation.py)``` pythonfrom torchvision_x.datasets import image_loaderfrom torchvision_x.transforms import transforms_seg,functionaltransform = transforms_seg.SegCompose([#     transforms_seg.SegFlip(),transforms_seg.SegVFlip(),# transforms_seg.SegHFlip(),# transforms_seg.SegRandomFlip(),# transforms_seg.SegRandomRotate(90),# transforms_seg.SegRandomShift(40),# transforms_seg.SegRandomCrop((256,256)),# transforms_seg.SegCenterCrop(224),# transforms_seg.SegResize(224),# transforms_seg.SegPad(20),# transforms_seg.SegNoise(dtype='uint16', var=0.001),  #TODO# transforms_seg.SegGaussianBlur(sigma=2, dtype='uint8', multichannel=False),# transforms_seg.SegPieceTransform(),#     transforms_seg.SegLambda(lambda x: functional.to_tensor(x))transforms_seg.SegToTensor(),transforms_seg.SegNormalize((0.5,0.5,0.5),(0.5,0.5,0.5)),])trainset = image_loader.SemanticSegmentationLoader(rootdir='sample-data/', lstpath='sample-data/segmentation_jpg.lst',filetype='jpg', transform=transform,)trainloader = DataLoader(dataset=trainset,batch_size=batch_size,shuffle=False)for step, (inputs, targets) in enumerate(trainloader):print('batch: {} ........'.format(step))print(type(inputs), inputs.shape)print(type(targets), targets.shape)```## TODO- Noise
Package: torchvision-raspi
torchvisionThe torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision.InstallationAnaconda:condainstalltorchvision-cpytorchpip:pipinstalltorchvision>From source:pythonsetup.pyinstallImage BackendTorchvision currently supports the following image backends:Pillow(default)Pillow-SIMD- amuch fasterdrop-in replacement for Pillow with SIMD. If installed will be used as the default.accimage- if installed can be activated by callingtorchvision.set_image_backend('accimage')DocumentationYou can find the API documentation on the pytorch website:http://pytorch.org/docs/master/torchvision/ContributingWe appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us.
Package: torchvtk
torchvtkPyTorch volume data loading frameworkDocumentationInstallation InstructionsThe latest GitHub release is pushed to PyPi:pip install torchvtkTo get the master run:pip install git+https://github.com/torchvtk/torchvtk.git@master#egg=torchvtkOptional for DICOM stuff only:conda create --name "tvtk" python=3.6 && conda activate tvtk
conda install gdcm -c conda-forge
pip install pydicom dicom_numpy h5py numpy matplotlibIf you need DICOM, and thus gdcm, your Python version needs to be <=3.6
Modifytvtkin the third line (both after--nameand at the end of the line) to your preferred environment name or just add the required packages to your existing environment.
Note that the restriction to Python <= 3.6 is due togdcmand higher version should work as well if you don't need DICOM loading capabilities.Creating the Numpy Files for the HDF 5 File generation.hdf5/nifiti_crawler.pyThis script generates out of the nifti Files of the Medical Decathlon Challenge numpy arrays that contain the images and the segmentation groundtruths.Creating the HDF5 Fileshdf5/hdf5_crawler.pyThis script generates hdf5 Files with different compression techniques. These files contain the image as well as the groundtruth. The image is normalized between [0,1] and is stored in the Float32 Format. The Groundtruth is saved as an Int16 Format. The used compressions are gzip, szip  and lzf.
Package: torch-waymo
torch_waymoLoad Waymo Open Dataset in PyTorchCite this repository:@software{Guimont-Martin_A_PyTorch_dataloader_2023,
    author = {Guimont-Martin, William},
    month = {1},
    title = {{A PyTorch dataloader for Waymo Open Dataset}},
    version = {0.1.1},
    year = {2023}
}UsageRequires:Python < 3.10Download the dataset# Login to gcloudgcloudauthlogin# Download the full datasetcd<path/to/waymo>
gsutil-mcp-r\"gs://waymo_open_dataset_v_1_4_1/individual_files/training"\"gs://waymo_open_dataset_v_1_4_1/individual_files/validation"\.Convert it# Make a tf venvpython-mvenvvenv_tfsourcevenv_tf/bin/activate
pipinstalltorch_waymo[waymo]# Convert all the datasettorch-waymo-convert--dataset<path/to/waymo># Or only convert the training splittorch-waymo-convert--dataset<path/to/waymo>--splittraining# Or convert multiple splitstorch-waymo-convert--dataset<path/to/waymo>--splittrainingvalidationLoad it in your projectNow that the dataset is converted, you don't have to depend onwaymo-open-dataset-tf-2-6-0in your project.
You can simply installtorch_waymoin your project.pipinstalltorch_waymoExample usage:fromtorch_waymoimportWaymoDatasettrain_dataset=WaymoDataset('~/Datasets/Waymo/converted','training')foriinrange(10):# frame is of type SimplifiedFrameframe=train_dataset[i]print(frame.timestamp_micros)
Package: torchwebio
torchwebioYet another model to web app generatortorchwebio is a simple package that turns your pytorch model into a web application.Why?Researchers often train models or fine tune models using pytorch and use dashboards like tensorboard to track the progress of the training routine.These dashboards often give you metrics like loss and accuracies and visualizing some sample images. But they don't help you visualize the actual real-world performance of your model in-training.Imagine you want to test your model against some other sample images that you didn't plan before starting the training routine. Imagine you want to share your "latest-greatest-and-bestest" model with your manager. Imagine you wanted to continuously train your model and always share the latest-and-greatest with the world.That's where this package comes in.Read the relevant blog posthereFind the documentationhereHow?The code that powers this package is actuallyvery, verysimple. It is built upon the shoulders of giants: pywebio for app generation, and timm for Image classification models.I am to be very opinionated, and support interfaces set out by the popular neural network libraries. This allows thewebalyzerinterface to be extremely simple, without needing to support all the "chaos" that exists out there.Problem typeLibraryStatusImage ClassificationtimmImplementedObject detection, Instance segmentationdetectron2Coming SoonNLP modelstransformersComing soonCredits topywebiofor a super simple framework for python web UI generation.Installpip install torchwebioUsageSimple visualizationimporttimmfromtorchwebio.webalyzerimportwebalyzer# Load a TIMM-like model or a regular pytorch modelmodel=timm.create_model('tf_efficientnet_b0_apss',pretrained=True)# ....# Fine tune the model# ....# Launch the web UIwebalyzer(model)Auto-updating application (coming soon!)importtimmfromtorchwebio.webalyzerimportwebalyzer,updater# Load a TIMM-like model or a regular pytorch modelmodel=timm.create_model('tf_efficientnet_b0_apss',pretrained=True)webalyzer(model)foridx,(data,labels)inenumerate(dataloader):# do some finetuningoutputs=model(data)loss=criterion(outputs,labels)loss.backward()# ....# update the app every 1000 iterationsifidx%1000==0:updater(model)For more examples, look into thedemofolderContributeCheck outCONTRIBUTING.md. More to come!Help outI don't do this a day job, but if you do want to help out, buy me a coffee. I promise to donate 100% of the proceeds on the account :)More than the money, this give me a data point on people "actually" interested in this project
Package: torchwindow
TorchWindowTorchWindow is a Python library that enables viewing of PyTorch Cuda Tensors on screen directly from GPU memory (No copying back and forth between GPU and CPU) via OpenGL-Cuda interop.Installpip install torchwindowUseTo create a windowfrom torchwindow import Window
window = Window(640, 480, name="Torch Window")To display an image tensor in the windowwindow.draw(image)imagemust be a tensor with the following properties:3 dimensions, specifically(rows, columns, channels)in that order.channelsdimension must be of size 4 (r, g, b, a)ExampleTo check if torchwindow is properly installed try runningpython3 -m torchwindow.exampleYou should see this window appear for 5 seconds before closing