Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Set Blob Size Based On YOLO Config #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mbsaloka
Copy link
Contributor

Jira Link:

Description

Set blob size based on width and height on yolo config

Type of Change

  • Bugfix
  • Enhancement
  • New feature
  • Breaking change (fix or feature that would cause the existing functionality to not work as expected)

How Has This Been Tested?

  • New unit tests added.
  • Manual tested.

Checklist:

  • Using Branch Name Convention
    • feature/JIRA-ID-SHORT-DESCRIPTION if has a JIRA ticket
    • enhancement/SHORT-DESCRIPTION if has/has no JIRA ticket and contain enhancement
    • hotfix/SHORT-DESCRIPTION if the change doesn't need to be tested (urgent)
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have made the documentation for the corresponding changes.

@mbsaloka mbsaloka changed the title feat: read size from cfg [Enhancement] Set Blob Size Based On YOLO Config Jul 13, 2024
Comment on lines 51 to 58
while (std::getline(ifs_cfg, cfg_line)) {
if (cfg_line.find("width") != std::string::npos) {
width = std::stoi(jitsuyo::split_string(cfg_line, "="));
} else if (cfg_line.find("height") != std::string::npos) {
height = std::stoi(jitsuyo::split_string(cfg_line, "="));
break;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This loop assumes that width is always above height in the cfg. You can do something like this in case the cfg is written otherwise:

Suggested change
while (std::getline(ifs_cfg, cfg_line)) {
if (cfg_line.find("width") != std::string::npos) {
width = std::stoi(jitsuyo::split_string(cfg_line, "="));
} else if (cfg_line.find("height") != std::string::npos) {
height = std::stoi(jitsuyo::split_string(cfg_line, "="));
break;
}
}
int flag = 0;
while (std::getline(ifs_cfg, cfg_line)) {
if (flag >= 2) break;
if (cfg_line.find("width") != std::string::npos) {
width = std::stoi(jitsuyo::split_string(cfg_line, "="));
flag++;
} else if (cfg_line.find("height") != std::string::npos) {
height = std::stoi(jitsuyo::split_string(cfg_line, "="));
flag++;
}
}

Copy link
Member

Choose a reason for hiding this comment

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

if (height != 0 && width != 0) {
  break;
}

instead of flag, what about this?

Copy link
Contributor

Choose a reason for hiding this comment

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

ow yeah, that's better

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.

4 participants