Git Product home page Git Product logo

models's Introduction

Models

ML model weights and trainable codes for Basars

Prepare Dependencies

pip install tensorflow requests pandas opencv-python
pip install git+https://github.com/Basars/trans-unet.git
pip install git+https://github.com/Basars/basars-addons.git

Training Your Own Basars

Make sure you've installed Python >= 3.8.

usage: python -m basars.train 
                [-h] --type {stairs,proj}
                [--num-classes NUM_CLASSES] [--epochs EPOCHS] 
                [--batch_size BATCH_SIZE] [--buffer_size BUFFER_SIZE]
                [--multiprocessing-workers MULTIPROCESSING_WORKERS] [--cache-dataset CACHE_DATASET]

Polyp Segmentation and Phase Classification from Endoscopic Images

optional arguments:
  -h, --help            show this help message and exit
  --type {stairs,proj}  The type of transformer model. Default value is 'stairs'
  --num-classes NUM_CLASSES
                        Number of classes to be classified. Default value is 5
  --epochs EPOCHS       Epochs that how many times the model would be trained. Default value is 1290
  --batch_size BATCH_SIZE
                        The batch size. Default value is 64
  --buffer_size BUFFER_SIZE
                        The buffer size for shuffling datasets. Default value is 1024
  --multiprocessing-workers MULTIPROCESSING_WORKERS
                        Number of workers for prefetching datasets. Default value is 64
  --cache-dataset CACHE_DATASET
                        True to cache datasets on memory otherwise don't. Default value is True

Training Sample

python -m basars.train --type proj --epochs 1290

Configuration Guide

Refer the repository: final-experiments

Weights

You can find out the weights in Releases.

Naming Convention and Meaning

stairs model have conv3x3 (256, 128, 64, 32, 16) โ†’ conv1x1 (5) upsamples

proj model have conv3x3 (256, 128, 64, 16) โ†’ conv1x1 (5, 5) upsamples

Model Definition

stairs model:

model = Sequential(name='ViT-stairs', layers=[
    VisionTransformer(input_shape=(224, 224, 3),
                      upsample_channels=(256, 128, 64, 32),
                      output_kernel_size=3, num_classes=16),
    Conv2D(5, kernel_size=(1, 1), padding='same', activation='softmax', use_bias=False)
])
model.load_weights('basars-cls5-stairs.h5')

proj model:

Sequential(name='ViT-proj', layers=[
    VisionTransformer(input_shape=(224, 224, 3), num_classes=5),
    Conv2D(5, kernel_size=(1, 1), padding='same', activation='softmax', use_bias=False)
])
model.load_weights('basars-cls5-proj.h5')

Model Architecture

architecture

Samples

sample0 sample1 sample2 sample3

models's People

Contributors

origamidream avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

ankit-rl4

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.