Export and Data Input for Mask2Former Instance Segmentation with Hugging Face
Budget: €50 – €150 EUR
I have a training script for Mask2Former for instance segmentation using Hugging Face. I need a Jupyter Notebook (running on Google Colab) to be updated based on the provided script in my ZIP file, which contains my current notebook (mask2former_train_01.ipynb).
There are two tasks to be completed.
Task 1: Export
- Export the trained Mask2Former model to ONNX format.
- The exported ONNX model must be fully compatible with OpenCV, ensuring that inference can be successfully performed using OpenCV.
- Base your work on the provided notebook: mask2former_train_01.ipynb.
Task 2: Data Input
- The current sample notebook uses panoptic segmentation data preparation, which does not support overlapping masks.
- Modify the data input pipeline to allow overlapping masks for instance segmentation.
- Suggested strategy:
* Images: RGB images.
* Masks: Multiple binary masks per image, where each mask corresponds to one instance (object).
* Class IDs: Assign a label for each mask (should work for more than one class, too)
* Data Loader Modifications:
** Provide a list of binary masks per image instead of a single segmentation map.
** Ensure that the data loader can handle a list of masks, with each stored as a separate grayscale image or as a binary channel in a multi-channel tensor.
* Instance-to-Semantic Mapping: Ensure that the instance_id_to_semantic_id mapping reflects the correct class for each instance, even when multiple instances of the same class exist.
* Utilize the Mask2FormerImageProcessor from Hugging Face to handle this new data format.
General Requirements:
- The final Jupyter Notebook must run successfully on Google Colab.
- The notebook must be provided as part of the deliverables and must execute without errors on my side.
- You must use your own Colab account for development and testing.
- Use only up-to-date and widely recognized Python packages (e.g., pandas, numpy, matplotlib).
- Include thorough documentation within the code to explain each step.
- Payment will only be made upon successful completion of all project tasks (see requirements above).
- All communication and transactions must be conducted exclusively through Freelancer.
There are two tasks to be completed.
Task 1: Export
- Export the trained Mask2Former model to ONNX format.
- The exported ONNX model must be fully compatible with OpenCV, ensuring that inference can be successfully performed using OpenCV.
- Base your work on the provided notebook: mask2former_train_01.ipynb.
Task 2: Data Input
- The current sample notebook uses panoptic segmentation data preparation, which does not support overlapping masks.
- Modify the data input pipeline to allow overlapping masks for instance segmentation.
- Suggested strategy:
* Images: RGB images.
* Masks: Multiple binary masks per image, where each mask corresponds to one instance (object).
* Class IDs: Assign a label for each mask (should work for more than one class, too)
* Data Loader Modifications:
** Provide a list of binary masks per image instead of a single segmentation map.
** Ensure that the data loader can handle a list of masks, with each stored as a separate grayscale image or as a binary channel in a multi-channel tensor.
* Instance-to-Semantic Mapping: Ensure that the instance_id_to_semantic_id mapping reflects the correct class for each instance, even when multiple instances of the same class exist.
* Utilize the Mask2FormerImageProcessor from Hugging Face to handle this new data format.
General Requirements:
- The final Jupyter Notebook must run successfully on Google Colab.
- The notebook must be provided as part of the deliverables and must execute without errors on my side.
- You must use your own Colab account for development and testing.
- Use only up-to-date and widely recognized Python packages (e.g., pandas, numpy, matplotlib).
- Include thorough documentation within the code to explain each step.
- Payment will only be made upon successful completion of all project tasks (see requirements above).
- All communication and transactions must be conducted exclusively through Freelancer.