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.7.tar.gz
(26.2 kB
view hashes)
Built Distribution
Close
Hashes for wk_classify-0.0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 194dda9c3fc898e3b636a3ea92431fe081e22442a4b492b262cff50cd4c0ac3f |
|
MD5 | 7af0e46d4eb1f48b2dd6837b72aee4de |
|
BLAKE2b-256 | 13ac894f9490d534381f05452e8fe91355d34d38031cbaa13cd062008039ac54 |