Skip to content

Semantic segmentation support#7

Open
SundarRajan98 wants to merge 4 commits into
developfrom
semantic_segm_support
Open

Semantic segmentation support#7
SundarRajan98 wants to merge 4 commits into
developfrom
semantic_segm_support

Conversation

@SundarRajan98
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown
Collaborator

@sampath1117 sampath1117 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address first round of review comments

* \return RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors
*/
extern "C" RocalMetaData ROCAL_API_CALL rocalCreateCOCOReader(RocalContext rocal_context, const char* source_path, bool is_output, bool mask = false, bool ltrb = true, bool is_box_encoder = false, bool avoid_class_remapping = false, bool aspect_ratio_grouping = false, bool is_box_iou_matcher = false);
extern "C" RocalMetaData ROCAL_API_CALL rocalCreateCOCOReader(RocalContext rocal_context, const char* source_path, bool is_output, bool is_polygon_mask = false, bool is_pixelwise_mask = false, bool ltrb = true, bool is_box_encoder = false, bool avoid_class_remapping = false, bool aspect_ratio_grouping = false, bool is_box_iou_matcher = false);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the description of this function w.r.t new parameter additions (is_polygon_mask, is_pixelwise_mask)

/// \param rocal_context
/// \param mask_ids The list of polygon id provided by user
/// \param sel_vertices_count List of vertices count for the selected polygons
/// \param sel_mask_ids List of Polygons ids for the selected polygons
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check and modify the variable names sel_vertices_count, sel_mask_ids. The prefix sel looks not very intuitive


///
/// \param rocal_context
extern "C" RocalTensorList ROCAL_API_CALL rocalRandomMaskPixel(RocalContext p_context);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the description for this function

/// \param is_foreground Select pixel from foreground if it is truw
/// \param value Select pixel coordinate whose value is equal to it
/// \param is_threshold Select pixel coordinate whose value is greater than given value param when bool is set as true
extern "C" void ROCAL_API_CALL rocalSetRandomPixelMaskConfig(RocalContext p_context, bool is_foreground=false, unsigned int value=0, bool is_threshold=true);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add space before and after = operator.
Applicable to all such new additions in this file

ROCAL_EXTSOURCE_RAW_UNCOMPRESSED = 2,
};

enum RocalRandomObjectBBoxFormat
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add description about this enum, similar to other enums

for (int j = 0; j < polygon_size[i]; j++) {
std::vector<double> in;
for (int k = 0; k < vertices_count[i][j]; k++, count++) {
in.push_back(mask_cords[count]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this in variable here?
Please check and change to better variable name if possible

@@ -0,0 +1,207 @@
# Copyright (c) 2018 - 2023 Advanced Micro Devices, Inc. All rights reserved.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the copyright to 2024

#include "meta_data_graph_factory.h"
#include "randombboxcrop_meta_data_reader_factory.h"
#include "node_copy.h"
#include "seed_rng.h"
Copy link
Copy Markdown
Collaborator

@sampath1117 sampath1117 Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #include "seed_rng.h" is already added in master_graph.h
Need not reinclude here

_output_random_object_bbox.clear();
_output_random_object_bbox.resize(_user_batch_size, std::vector<unsigned>(4, 0));
for (unsigned id = 0; id < _user_batch_size; id++) {
int *in_mask_buffer = (int *)(input->at(id)->buffer());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use static cast here

auto random_mask_pixel_info = default_random_mask_pixel_info;
_random_mask_pixel_list.push_back(new Tensor(random_mask_pixel_info));
auto random_object_bbox_info = default_random_object_bbox_info;
_random_object_bbox_list.push_back(new Tensor(random_object_bbox_info));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure to release the memory allocated for this new tensor in the release function of master graph

for (auto tensor_list : _metadata_output_tensor_list)

I could see vx tensor is getting release here, not sure if the actual tensor is getting freed also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants