USV-based Embedded Obstacle Segmentation

25 views
Skip to first unread message

sabari nathan

unread,
Dec 12, 2024, 1:56:30 AM12/12/24
to MaCVi Support

I trained a model using TensorFlow and exported it to ONNX. After exporting, the input shape of the ONNX model is [1, 384, 768, 3].

  1. Do I need to change the model's input shape?
  2. The dataset contains an "Ignore" class alongside 3 other classes. Should I include the "Ignore" class in the predictions, or should I exclude it?
  3. What does a single-node output mean?

The expected output for the model is:

  • A single output node.
  • A 1x1x384x768 tensor of predictions (argmaxed logits).

However, the training dataset has 3 classes . Could you clarify how the input channels and classes relate to the single-node output?

Lojze Žust

unread,
Dec 12, 2024, 10:26:45 AM12/12/24
to MaCVi Support
Hello Nathan,

I trained a model using TensorFlow and exported it to ONNX. After exporting, the input shape of the ONNX model is [1, 384, 768, 3].

  1. Do I need to change the model's input shape?
The evaluation expects the input shape to be [1, 3, 384, 768], so I expect your ONNX to have issues due to different ordering of dimensions. I recommend you add an additional operation at the start of the ONNX that converts the tensor from [1, 3, 384, 768] to your expected [1, 384, 768, 3].
  1. The dataset contains an "Ignore" class alongside 3 other classes. Should I include the "Ignore" class in the predictions, or should I exclude it?
 If your method also predicts ignore, you may include it, but it will be ignored by the evaluation. Only classes 0,1 and 2 are counted in evaluation.
  1. What does a single-node output mean?
It means you ONNX declares a single output tensor node. Number of channels is 1, because you need to return predicted labels class directly (0, 1 or 2), not probabilities.

Hope this answers your questions!

Best,
Lojze Zust
MaCVi Team

Matija Tersek

unread,
Dec 13, 2024, 3:17:58 PM12/13/24
to Lojze Žust, MaCVi Support
Hi Nathan,

To add on the input shape - if you use something like tensorflow-onnx (https://github.com/onnx/tensorflow-onnx), you can use --inputs-as-nchw flag to transpose the inputs.

Best,
Matija

Want early access to new products? Join our free Innovation Lab to get early access to hardware and software products. You will also get the opportunity to shape core software solutions built by our development team for your use.


--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "MaCVi Support" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an macvi-suppor...@googlegroups.com.
Diese Diskussion finden Sie unter https://groups.google.com/d/msgid/macvi-support/d116cc6e-c0ec-4eee-83bf-b5b5933d931fn%40googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages