Skip to content

Bounding Box API#55

Merged
luisremis merged 2 commits intodevelopfrom
feature_boundingbox
Jan 1, 2019
Merged

Bounding Box API#55
luisremis merged 2 commits intodevelopfrom
feature_boundingbox

Conversation

@crstrong
Copy link
Copy Markdown
Contributor

Support for the Bounding Box API for rectangles, along with tests (both in C++ and Python).

@luisremis
Copy link
Copy Markdown
Contributor

Something off with the tests on my setup:

[----------] 1 test from FindImage
[ RUN ] FindImage.simpleFind
[Exception] ObjectEmpty at src/ImageData.cc:70
db/images/png/4c328cc66771034.png could not be read, object is empty
tests/json_queries.cc:138: Failure
Value of: "0"
Expected: json_response[0]["FindImage"]["status"].asString()
Which is: "-1"
[ FAILED ] FindImage.simpleFind (10 ms)
[----------] 1 test from FindImage (10 ms total)

[----------] 1 test from UpdateEntity
[ RUN ] UpdateEntity.simpleAddUpdate
[ OK ] UpdateEntity.simpleAddUpdate (21 ms)
[----------] 1 test from UpdateEntity (21 ms total)

[----------] 1 test from QueryHandler
[ RUN ] QueryHandler.AddAndFind
[ OK ] QueryHandler.AddAndFind (36 ms)
[----------] 1 test from QueryHandler (36 ms total)

[----------] 5 tests from BoundingBox
[ RUN ] BoundingBox.simpleAdd
[ OK ] BoundingBox.simpleAdd (15 ms)
[ RUN ] BoundingBox.addAndFind
[ OK ] BoundingBox.addAndFind (13 ms)
[ RUN ] BoundingBox.addWithImage
[ OK ] BoundingBox.addWithImage (15 ms)
[ RUN ] BoundingBox.addAndFindCoordinates
[ OK ] BoundingBox.addAndFindCoordinates (13 ms)
[ RUN ] BoundingBox.findBBWithBlob
[Exception] ObjectEmpty at src/ImageData.cc:158
Image object is empty
[Exception] ObjectEmpty at src/ImageData.cc:158
Image object is empty
[ OK ] BoundingBox.findBBWithBlob (12 ms)
[----------] 5 tests from BoundingBox (68 ms total)

@crstrong
Copy link
Copy Markdown
Contributor Author

crstrong commented Dec 3, 2018

You may have to add a db/images/png folder to the test folder. I believe I needed to.

@luisremis
Copy link
Copy Markdown
Contributor

cool, will make a note to add that on the scripts as part of the PR.

Copy link
Copy Markdown
Contributor

@luisremis luisremis left a comment

Choose a reason for hiding this comment

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

Looks good, some notes here:
Add the necessary creation of folders to the tests scripts.
Also, both commits have modification on the functionality files. It is better to have all the functionality added in the first commit and all the testing in the second, so it is better to rework the commits.

@crstrong crstrong force-pushed the feature_boundingbox branch from 45778ba to 28c2b1b Compare December 5, 2018 00:49
@vishakha041
Copy link
Copy Markdown
Contributor

Should I review this PR or wait for updates from what Luis has requested?

@crstrong
Copy link
Copy Markdown
Contributor Author

I believe all of his comments have been addressed, so please do review the PR

Copy link
Copy Markdown
Contributor

@vishakha041 vishakha041 left a comment

Choose a reason for hiding this comment

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

This looks almost ready to go with a few simple changes.

@crstrong crstrong force-pushed the feature_boundingbox branch from 28c2b1b to 921cb08 Compare December 18, 2018 19:33
src/defines.h Outdated

// Regions

#define VDMS_ROI_TAG "VD::ROI"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: Is there a reason there are two colons here and 1 everywhere else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably muscle memory from typing classes ;)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this was not fixed in the final version, will fix it.

vishakha041
vishakha041 previously approved these changes Dec 18, 2018
Copy link
Copy Markdown
Contributor

@vishakha041 vishakha041 left a comment

Choose a reason for hiding this comment

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

Looks good. I see that you have updated the wiki pages too. Cool.

src/defines.h Outdated
#define VDMS_ROI_IMAGE_EDGE "VD:ROIIMGLINK"
#define VDMS_ROI_SHAPE_PROP "VD:ROISHAPE"

#define ROI_COORD_X "_x1"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this are inconsistent with the rest of defines and property names.

src/defines.h Outdated

// Regions

#define VDMS_ROI_TAG "VD::ROI"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this was not fixed in the final version, will fix it.


BoundingBoxCommand(const std::string &cmd_name);

std::string get_img_path(PMGDQuery &query_tx, Json::Value link);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this functions is not defined or used, will remove it.


// Helper classes for handling various JSON commands.

class BoundingBoxCommand : public RSCommand
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this class is not needed, the command can inherit from RSCommand directly. there is nothing specialized and shared between the bondingboxes commands.

src/defines.h Outdated
#define VDMS_ROI_TAG "VD::ROI"
#define VDMS_ROI_EDGE_TAG "VD:ROILINK"
#define VDMS_ROI_IMAGE_EDGE "VD:ROIIMGLINK"
#define VDMS_ROI_SHAPE_PROP "VD:ROISHAPE"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not used.

get_value<int>(coords, "w"),
get_value<int>(coords, "h")));

VCL::ImageFormat format = VCL::PNG;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if the image was originally jpg, we will force a change of format. we need to use the format of the original file by default.

else if (requested_format == "jpg") {
format = VCL::JPG;
}
else {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is checked in the json schema, no need to check here again

@luisremis luisremis force-pushed the feature_boundingbox branch from 7236c68 to 340207a Compare January 1, 2019 04:27
@luisremis luisremis merged commit fa6d85b into develop Jan 1, 2019
@luisremis luisremis deleted the feature_boundingbox branch January 30, 2019 18:11
Ragaad pushed a commit to Ragaad/vdms that referenced this pull request Jun 16, 2022
brain.png that is referenced in distributed/helpers.h uses image from test folder. This file is unused in this directory. Missed during review.
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.

3 participants