Skip to main content

TorchSketch is an open source software library for free-hand sketch oriented deep learning research, which is built on the top of PyTorch.

Project description

TorchSketch

PyPI

TorchSketch is an open source software library for free-hand sketch oriented deep learning research, which is built on the top of PyTorch.

The project is under continuous update!

1. Installation

TorchSketch is developed based on Python 3.7.

To avoid any conflicts with your existing Python setup, it's better to install TorchSketch into a standalone environment, e.g., an Anaconda virtual environment.

Assume that you have installed Anaconda. Please create a virtual environment before installation of TorchSketch, as follows.

# Create a virtual environment in Anaconda.
conda create --name ${CUSTOMIZED_ENVIRONMENT_NAME} python=3.7

# Activate it.
conda activate ${CUSTOMIZED_ENVIRONMENT_NAME}

1.1 Using pip

Please use the following command to install TorchSketch.

pip install torchsketch

Then, TorchSketch can be imported into your Python console as follows.

import torchsketch

1.2 From Source

In addition, TorchSketch also can be installed from source.

# Choose your workspace and download this repository.
cd ${CUSTOMIZED_WORKSPACE}
git clone https://github.com/PengBoXiangShang/torchsketch

# Enter the folder of TorchSketch.
cd torchsketch

# Install.
python setup.py install

2. Major Modules and Features of TorchSketch

2.1 Major Modules

TorchSketch has three main modules, including data, networks, utils, as shown in follows. The documents are provided in docs.

  • torchsketch
    • data
      • dataloaders: provides the dataloader class files for the frequently-used sketch datasets, e.g., TU-Berlin, Sketchy, QuickDraw.
      • datasets: provides the specific API for each dataset, which integrates a series of functions including downloading, extraction, cleaning, MD5 checksum, and other preprocessings.
    • networks
      • cnn: provides all the SOTA CNNs.
      • gnn: provides the sketch-applicable implementations of GNNs, including GCN, GAT, graph transformer, etc.
      • rnn: provides the sketch-applicable implementations of RNNs.
      • tcn: provides the sketch-applicable implementations of TCNs.
    • utils
      • data_augmentation_utils
      • general_utils
      • metric_utils
      • self_supervised_utils
      • svg_specific_utils
    • docs
      • api_reference
      • examples

These modules and sub-modules can be imported as follows.

import torchsketch.data.dataloaders as dataloaders
import torchsketch.data.datasets as datasets

import torchsketch.networks.cnn as cnns
import torchsketch.networks.gnn as gnns
import torchsketch.networks.rnn as rnns
import torchsketch.networks.tcn as tcns

import torchsketch.utils.data_augmentation_utils as data_augmentation_utils
import torchsketch.utils.general_utils as general_utils
import torchsketch.utils.metric_utils as metric_utils
import torchsketch.utils.self_supervised_utils as self_supervised_utils
import torchsketch.utils.svg_specific_utils as svg_specific_utils

2.2 Major Features

  • TorchSketch supports both GPU based and Python built-in multi-processing acceleration.
  • TorchSketch is modular, flexible, and extensible, without overly complex design patterns and excessive encapsulation.
  • TorchSketch provides four kinds of network architectures that are applicable to sketch, i.e., CNN, RNN, GNN, TCN.
  • TorchSketch is compatible to not only numerous datasets but also various formats of free-hand sketch, e.g., SVG, NumPy, PNG, JPEG, by providing numerous format-convert APIs, format-specific APIs, etc.
  • TorchSketch supports self-supervised learning study for sketch.
  • TorchSketch, beyond free-hand sketch research, also has some universal components that are applicable to the studies for other deep learning topics.

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

torchsketch-0.1.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

torchsketch-0.1.0-py3-none-any.whl (62.4 kB view details)

Uploaded Python 3

File details

Details for the file torchsketch-0.1.0.tar.gz.

File metadata

  • Download URL: torchsketch-0.1.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for torchsketch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 19961539973e41d007d4312ce68f9e15f7025de0743ebedb395af1285cbea801
MD5 625a58abe428aadb87b0727ac93a0fe9
BLAKE2b-256 09150d82c042992c8cd6d4ad8ec23d54ff2d987b64a9a987cacd4e655ca1590d

See more details on using hashes here.

File details

Details for the file torchsketch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: torchsketch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 62.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for torchsketch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f215d4f7b2bbc330eafbe4de00d00b2d27f5928867203bd0abbe507aefb0fbf
MD5 04fc10172932ce101140cf2672cca7a0
BLAKE2b-256 0d8c5fd108bc0969a246987e65109ea6d78d128a0e27cd50ce087c457b1da092

See more details on using hashes here.

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