A package of tools for building deep-learning classification programs.
Project description
wk-classify
A package of tools for building deep-learning classification programs. Easy to use, light and powerful.
Install
pip3 install wk-classify
Usage
quick experience
from wcf.packages.resnet.training import train, BaseConfig
class Config(BaseConfig):
TRAIN_DIR = 'path for train set'
VAL_DIR = 'path for val set'
cfg=Config()
train(cfg)
a real example
from wcf.packages.resnet.training import train, BaseConfig
from torchvision import transforms
class Config(BaseConfig):
GEN_CLASSES_FILE = True
USE_tqdm_TRAIN = False # use tqdm to format output
INPUT_SIZE = (252,196)
BATCH_SIZE = 16
NUM_EPOCHS = 50
BALANCE_CLASSES = True
VAL_INTERVAL = 0.2 # val time insterval: 0.2 epoch (0.2* num_batches_per_epoch)
WEIGHTS_SAVE_INTERVAL = 0.2 # the same as above
TRAIN_DIR = '<your train path>'
VAL_DIR = '<your val path>'
train_transform = transforms.Compose([
transforms.ColorJitter(brightness=0.1, contrast=0.1, saturation=0.1, hue=0.5),
transforms.Resize(INPUT_SIZE),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
val_transform = transforms.Compose([
transforms.Resize(INPUT_SIZE),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
cfg=Config()
train(cfg)
all options
check out the BaseConfig
class for all options
how to predict?
check out demo_predict.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wk-classify-0.0.0.4.tar.gz
(28.2 kB
view hashes)
Built Distribution
Close
Hashes for wk_classify-0.0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7098a1c3735848ba209d44002275e471d93ec3b64638084b597b2bb15887f0fe |
|
MD5 | d169a67e23d1cbd621afdd5a5519360a |
|
BLAKE2b-256 | 4c98caff45fda259b5f5834c70b3db949b96c0db19a4c8578cf235e96df2ee6d |