Skip to main content

A Python library to resize images using PyTorch

Project description

# Resize Images using PyTorch

This package allows resizing images from the command line using PyTorch.

## Dependencies

  • Python 3.4++

  • gputil 1.4.0

  • tqdm 4.59.0

  • torchvision 0.9.0

  • torch 1.8.0

  • Pillow 2.7++

## Installation

Install torch-resize-images using pip:

` pip install torch-resize-images `

## Usage

Given images in some <input_dir>, the following line first resizes and then center-crops all images to the size 224x224.

` torch-resize -r <input_dir> -o <output_dir> --width 224 --height 224 `

You can speed up processing by running multiple processes in parallel using the -n flag. This defaults to 1 and is limited by your system memory.

` torch-resize -r <input_dir> -o <output_dir> --width 224 --height 224 -n 8 `

## Example ![Alt text](./images/resize.png “Example File”)

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

torch-resize-images-0.1.7.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distributions

torch_resize_images-0.1.7-py3.8.egg (5.4 kB view hashes)

Uploaded Source

torch_resize_images-0.1.7-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

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