Skip to content

Make ImageSegmentation preprocess consistent with other CV models #374

@pweglik

Description

@pweglik

In ImageSegmentation.cpp we do:

 cv::Size inputSize = input.size();

  cv::resize(input, input, modelImageSize);

  std::vector<float> inputVector = imageprocessing::colorMatToVector(input);
  return {
      executorch::extension::make_tensor_ptr(getInputShape()[0], inputVector),
      inputSize};

but in other models we do:

return {imageprocessing::getTensorFromMatrix(getInputShape()[0], image),
          originalSize};

From my understanding those are equivalent and using util function is great, so let's keep our implementations consistent. Btw it looks like it could be one util function and not a method - we duplicate a lot of code this way, which causes problems in cases like this

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions