Skip to content

IngRaffaeleMineo/3D-BCPTcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D-BCPTcode: A 3D Basic Classification Parallelized Training code

Raffaele Mineo

How to run

The code expects a JSON file in the format support by MONAI, passed via the --split_path argument, with the following structure:

{
 "num_fold": <N>, 
 "fold0": { "train": [ {"image": <path>,
                        "image2": <path>,
                        "label": <class>},
                       ...
                       {"image": <path>,
                        "image2": <path>,
                        "label": <class>}
                      ],
            "val": [ {"image": <path>,
                        "image2": <path>,
                        "label": <class>},
                      ...],
            "test": [{"image": <path>,
                      "image2": <path>,
                      "label": <class>},
                      ...]}, 
 "fold1": { "train": [...],
            "val": [...],
            "test": [...]},
...
}

<N>, <path> and <class> fields should be filled as appropriate. Each path should point to a .npyfile containing a 3D (2D+T) tensor, representing a video.

Pre-requisites:

Train Example

To start training, simply run (using default arguments):

python train.py --root_dir='<dataset_path>' --split_path='<split_json_path>'

To start distributed training, use:

python -m torch.distributed.launch --nproc_per_node=<N_GPUS> --use_env train.py --root_dir='<dataset_path>' --split_path='<split_json_path>'

Test Example

To start evaluation, simply run (using default arguments):

python test.py --logdir='<log_path>' --start_tornado_server=1 --enable_explainability=1

Log directories are automatically created upon training inside a logs directory.

To start distributed testing, use:

python -m torch.distributed.launch --nproc_per_node=<N_GPUS> --use_env test.py --logdir='<log_path>' --start_tornado_server=1 --enable_explainability=1

Notes

Please, remember to insert the following acknowledgement in your code, thanks: This code is taken from https://github.com/IngRaffaeleMineo/3D-BCPTcode and modified to our purposes.

Acknowledgements

https://github.com/MECLabTUDA/M3d-Cam
https://github.com/jacobgil/pytorch-grad-cam

About

3D - B(asic) C(lassification) P(arallelized) T(raining) code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors