Giter VIP home page Giter VIP logo

orchestrain's Introduction

OrchesTrain

OrchesTrain is a Pytorch-based toolbox for training and running classification, segmentation and object detection models.

Training

To train any model in OrchesTrain you first need to create a config that defines dataset properties, model type, loss function and other training stuff. You can see examples for segmentation models in data/semantic_segmentation and examples for classification in data/classification/. Detailed explanation of configs is given in Configs section.

Semantic Segmentation

To train segmentation models you only need to create/choose a config file that defines your experiment properties.

Example training command for segmentation:

python train.py train --data ./data/semantic_segmentation/cityscapes.yml --project cityscapes

Classification

You can train torchvision models to make transfer learning or you can create a new custom model. We have provided an example of Resnet18 transfer learning training yaml configuarion and also a custom model training configuarion. We also support torchvision datasets, you can see example training configuration in data/classification/cifar10.yaml.

Example training command for classification:

python train.py train --data ./data/classification/cifar10.yml --project cifar10

Configs

Designing an experiment config

  • Currently for segmentation experiments all features are supported cityscapes and for classification experiments you can use ClassificationDataset and TorchVisionDataset. You can simply create a dataset for segmentation

    dataset:
        train:
            type: CityScapesDataset
            num_workers: 6
            image_sz: &image_sz [1024, 512]
            root_path: cityscapes/gtFine_trainvaltest/gtFine/train
            augment:
            A.HorizontalFlip:
                p: 0.5
            """Other augmentation methods"""
        valid:
            type: CityScapesDataset
            num_workers: 6
            image_sz: *image_sz
            root_path: cityscapes/gtFine_trainvaltest/gtFine/val
    
  • You can specify augmentations as

    augment:
        A.Rotate:
            limit: [-10,10]
        A.VerticalFlip
    

We support all of the albumentation augmentations. Also you can write your own custom augmentation class.

  • You can specify your model class name like:

    model:
    type: UNet
    

    but you need to be careful about that you have to specify path of the given class.

    model:
    type: UNet_ResPath
    import_from: train_app.models.semantic_segmentation.unet
    

    you can also send argumants to your model class with args:

    args:
        in_channels: 3
        out_channels: 20
    
  • Defining loss function is can be done like:

    losses:
    - loss:
        type: CrossEntropyLoss
        weights: 1
    

    you can change args with respect to your loss function.

Scripts

  • converter is used to convert trained model to torch script which can be used in c++ and other applications.

Known Issues

orchestrain's People

Contributors

slymnpmk avatar umut-tirasoglu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.