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 start
from wcf import train, TrainValConfigBase
class Config(TrainValConfigBase):
TRAIN_DIR = 'path for train set'
VAL_DIR = 'path for val set'
cfg=Config()
train(cfg)
A real example
from wcf import train, TrainValConfigBase, val,t,EasyTransform,models_names
class Config(TrainValConfigBase):
MODEL_TYPE = models_names.shufflenet_v2_x0_5
TAG = '[%s]'%(MODEL_TYPE)
GEN_CLASSES_FILE = True
USE_tqdm_TRAIN = True
INPUT_SIZE = (252,196) #(w,h)
BATCH_SIZE = 64
MAX_EPOCHS = 200
BALANCE_CLASSES = True
VAL_INTERVAL = 1
WEIGHTS_SAVE_INTERVAL = 1
WEIGHTS_INIT = 'weights/training/model_best.pkl'
TRAIN_DIR = '/home/ars/sda5/data/projects/烟盒/data/现场采集好坏烟照片/相机1-train'
VAL_DIR = '/home/ars/sda5/data/projects/烟盒/data/现场采集好坏烟照片/相机1-val'
val_transform = EasyTransform([
t.Resize(INPUT_SIZE[::-1]),
t.SaveToDir('data/test'),
t.ToTensor(),
])
train_transform = EasyTransform([
t.ColorJitter(brightness=0.2, contrast=0, saturation=0, hue=0),
# t.RandomHorizontalFlip(),
# t.RandomVerticalFlip(),
# t.RandomRotate(360),
t.RandomTranslate(30),
t.RandomBlur(p=0.3, radius=1),
t.RandomSPNoise(p=0.3),
*val_transform,
])
# def get_model(self, num_classes=None):
# model=YourModel(...)
# return model
if __name__ == '__main__':
cfg = Config()
train(cfg)
# res=val(cfg)
# print(res)
all options
see the TrainValConfigBase class for all options
how to predict?
see demo_predict.py
more
see demo_train.py and demo_predict.py
Release files for wk-classify 0.0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wk-classify-0.0.3.5.tar.gz | 24.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wk_classify-0.0.3.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.6 kB
Release files / wk-classify-0.0.3.5.tar.gz
| Download URL | wk-classify-0.0.3.5.tar.gz |
|---|---|
| Size | 24.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d0e92fadda9b9f71db35bdd1aceaddd4348c2ad2f69d29b61bd7521ae66270e
|
|
BLAKE2b-256 checksum How to use checksums |
57b108565928bb24c6991b6e154271b6544aa8190669f44817a362993adb0d8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9
|
Release files / wk_classify-0.0.3.5-py3-none-any.whl
| Download URL | wk_classify-0.0.3.5-py3-none-any.whl |
|---|---|
| Size | 31.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4294fcd0b53e6dd45fc1fdb51d0b3fb438dc4141d1614accd6357eabb0f0dfb1
|
|
BLAKE2b-256 checksum How to use checksums |
8e1fcd1792e7d505d3d6607383ac6082e6981776957c2bba76512b7defc6df7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9
|