Package: torchsketch
TorchSketchTorchSketch is an open source software library for free-hand sketch oriented deep learning research, which is built on the top ofPyTorch.The project is under continuous update!1. InstallationTorchSketch 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.condacreate--name${CUSTOMIZED_ENVIRONMENT_NAME}python=3.7# Activate it.condaactivate${CUSTOMIZED_ENVIRONMENT_NAME}1.1 Using pipPlease use the following command to install TorchSketch.pipinstalltorchsketchThen, TorchSketch can be imported into your Python console as follows.importtorchsketch1.2 From SourceIn addition, TorchSketch also can be installed from source.# Choose your workspace and download this repository.cd${CUSTOMIZED_WORKSPACE}gitclonehttps://github.com/PengBoXiangShang/torchsketch# Enter the folder of TorchSketch.cdtorchsketch# Install.pythonsetup.pyinstall2. Major Modules and Features of TorchSketch2.1 Major ModulesTorchSketch has three main modules, includingdata,networks,utils, as shown in follows.
The documents are provided indocs.torchsketchdatadataloaders: 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.networkscnn: 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.utilsdata_augmentation_utilsgeneral_utilsmetric_utilsself_supervised_utilssvg_specific_utilsdocsapi_referenceexamplesThese modules and sub-modules can be imported as follows.importtorchsketch.data.dataloadersasdataloadersimporttorchsketch.data.datasetsasdatasetsimporttorchsketch.networks.cnnascnnsimporttorchsketch.networks.gnnasgnnsimporttorchsketch.networks.rnnasrnnsimporttorchsketch.networks.tcnastcnsimporttorchsketch.utils.data_augmentation_utilsasdata_augmentation_utilsimporttorchsketch.utils.general_utilsasgeneral_utilsimporttorchsketch.utils.metric_utilsasmetric_utilsimporttorchsketch.utils.self_supervised_utilsasself_supervised_utilsimporttorchsketch.utils.svg_specific_utilsassvg_specific_utils2.2 Major FeaturesTorchSketch 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.