Skip to content

Scene recognition models based on pytorch1.x and TF2.x. Provide training, test and conversion scripts as well as many pretrained models. Hands-on tutorial about deploying a model.

License

Notifications You must be signed in to change notification settings

Phoenix1327/scene-recognition-pytorch1.x-tf2.x

Repository files navigation

Scene-Recognition-Service-PyTorch-TF2.0

Scene recognition models based on pytorch and TF2.0. Upgraded from https://github.com/CSAILVision/places365

Install

conda env create -f environment.yml python=3.7

conda activate scene_pytorch_tf

export PYTHONPATH=$PYTHONPATH:$(pwd)

Model Zoo (Pretrained Models)

Please refer [Model Zoo]

Train

We download the data from http://places2.csail.mit.edu/download.html

PyTorch == 1.x

1. Download the data

These images are 256x256 images, in a more friendly directory structure that in train and val split the images are organized such as train/reception/00003724.jpg and val/raft/000050000.jpg

sh download_data_pytorch.sh

2. Train the model with multiple GPUs

python tools/train.py

3. Remove the .module

python scripts/remove_pytorch_module.py

4. Test a model

Donwload pretrained weights from https://drive.google.com/drive/folders/1NbV3NZlgbqnLSd9zwZoz8kFpNQjUYolT?usp=sharing

python tools/test.py

5. Convert a model to TorchScript

python scripts/convert_torchscript.py

Tensorflow == 2.x

1. Download the data. (Refer: https://github.com/tensorflow/datasets)

python -m tensorflow_datasets.scripts.download_and_prepare --datasets=places365_small
  • 2. Train the model with multiple GPUs

  • 3. Test models

About

Scene recognition models based on pytorch1.x and TF2.x. Provide training, test and conversion scripts as well as many pretrained models. Hands-on tutorial about deploying a model.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published