Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmaaz60/mobilevit
https://github.com/mmaaz60/mobilevit
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mmaaz60/mobilevit
- Owner: mmaaz60
- License: other
- Created: 2022-03-31T14:55:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-28T00:27:07.000Z (over 2 years ago)
- Last Synced: 2024-10-10T18:11:04.883Z (about 1 month ago)
- Language: Python
- Size: 284 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-pytorch-to-coreml.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Converting models trained using CVNets to CoreML
For conversion, we assume that you are using `MAC OS` machine.
## Classification networks
We can convert the classification models using the following command
```
export EVAL_DIR='' # Location of results
export CKPT_NAME='' # Name of the pre-trained model weight file (e.g., checkpoint_ema.pt)
cvnets-convert --common.config-file "${EVAL_DIR}/config.yaml" --common.results-loc $EVAL_DIR --model.classification.pretrained "${EVAL_DIR}/${CKPT_NAME}" --conversion.coreml-extn mlmodel
```## Detection networks
We can convert the detection models trained on MS-COCO (81 classes, including background) using the following command
```
export EVAL_DIR='' # Location of results
export CKPT_NAME='' # Name of the pre-trained model weight file (e.g., checkpoint_ema.pt)
cvnets-convert --common.config-file "${EVAL_DIR}/config.yaml" --common.results-loc $EVAL_DIR --model.detection.pretrained "${EVAL_DIR}/${CKPT_NAME}" --conversion.coreml-extn mlmodel --model.detection.n-classes 81
```## Segmentation networks
We can convert the segmentation models trained on the PASCAL VOC 2012 dataset (21 classes, including background) using the following command
```
export EVAL_DIR='' # Location of results
export CKPT_NAME='' # Name of the pre-trained model weight file (e.g., checkpoint_ema.pt)
cvnets-convert --common.config-file "${EVAL_DIR}/config.yaml" --common.results-loc $EVAL_DIR --model.segmentation.pretrained "${EVAL_DIR}/${CKPT_NAME}" --conversion.coreml-extn mlmodel --model.segmentation.n-classes 21
```