Welcome to the forum Cristian! Thanks for posting your question and for trying out TensorFlow.js!
So our bodypix model is currently trained on human bodies as you have guessed. If you want to make your own segmentation model for a custom thing you will need to start collecting annotated training data (1000s of images) with examples of the thing you are trying to recognize and ensure you have a pixel level segmentation available for each image from which the model can learn from.
Do you have the training data? That would be your first task.
You can then choose a segmentation model you want to retrain for it to learn from your data instead.
To do that you have a number of options:
- Find an unfrozen model that has already been defined and retrain it with your data (easier but may have to start in Python first and then convert to TensorFlow.js with our converter).
A good tutorial for (1) is by our community expert Hugo Zanini:
- Write the code yourself to define the model using the TensorFlow.js APIs and train that (harder)
Maybe @Shanqing_Cai has some thoughts here though as he actually worked on BodyPix!