Few questions what's possible and what's not with TFJS

Hi All,

I’m pretty fresh in the world of ML. I looked at several examples of TFJS from the official repo, but this one got my attention:

For educational purposes I like to train my own model in TFJS. I want to train the model to recognize specific objects in a picture. The type of the object is only one type, so no categorization/labelling would be needed. Looking at the above example, I have few questions:

  1. I have my image dataset for the training, but few images have different dimensions. Do all images have to have the exact same dimensions? (in the example they do)
  2. For the object bounding box, can I use quadrilaterals instead of rects? (the example is using rects)
  3. Can I have multiple objects, respectfully multiple bounding boxes in a single image? (in the above example there is only one object in an image)

Thanks in advance!

Hi @ickata ,

I apologize for the delayed response.

Yes, all the images should have the same size. You can either resize the training image data to the same size, or you can use tf.image.resizeBilinear to reshape image."

No, we cannot change the shape of the bounding boxes; they will always be rectangular. Currently, there is no API available in tfjs to modify the bounding box shape.

Yes, with a model like COCO-SSD, you can get multiple bounding boxes for multiple objects. However, the given example uses the MobileNet V1 model, which is designed for image classification, so it will not return bounding boxes.

Let me know if it helps. Thank You!!