Instructions for the Cellpose to ONNX conversion script.
Instructions for the Cellpose to ONNX conversion script.
As of arivis Vision4D 4.1.1, Cellpose-like segmentation is supported natively in the analysis pipeline. However, arivis does not use the native Cellpose model format and instead uses the ONNX standard. Therefore, if we want to use custom Cellpose models in arivis these first need to be converted to the right format. The script linked below automatically converts all Cellpose models, including custom models, for use with arivis.
First, download the script file here: Cellpose_to_onnx.py
Copy and paste the py file in the main folder of your cellpose python solution.
The script requires that the ONNX python libraries are installed. If these libraries are not yet installed, or you just want to make sure you have the latest:
The script has two options:
Command line: python cellpose_to_onnx
This is only possible if users don't move the models to different folders as cellpose initially saves them
Command line: python cellpose_to_onnx.py --model_path [FULL_PATH_TO_THE_MODEL] --mean_diamter [30. or 17.]
The script automatically outputs the converted model to the same folder as the input. To change the output folder, where the ONNX models are saved we need to ad --output to the command line.
Command line: python cellpose_to_onnx.py --output_directory [DIRECTOY_TO_SAVE_ONNX_FILES]