mirror of
https://github.com/foomo/coreml-service-yolov8.git
synced 2025-10-16 12:25:42 +00:00
25 lines
656 B
Bash
Executable File
25 lines
656 B
Bash
Executable File
#!/bin/zsh
|
|
|
|
# needs a mac
|
|
|
|
# install miniconda
|
|
echo "setting up conda in ${MODEL_EXPORT_DIR}"
|
|
brew install miniconda
|
|
eval "$(conda "shell.$(basename "${SHELL}")" hook)"
|
|
|
|
# cleanup previous attempt gracefully
|
|
conda init
|
|
conda deactivate || echo "nothing to conda deactivate"
|
|
conda remove -y -n coreml-service-yolov8 --all || echo "no env to remove"
|
|
|
|
# create env from file
|
|
conda env create -f environment.yml
|
|
conda init
|
|
# activate env
|
|
conda activate coreml-service-yolov8
|
|
|
|
# coreml export and conversion
|
|
cd ${MODEL_EXPORT_DIR}
|
|
yolo export model=yolov8m-oiv7.pt format=mlmodel nms=True
|
|
xcrun coremlcompiler compile yolov8m-oiv7.mlmodel ${MODEL_EXPORT_DIR}
|