Skip to content

Feature/datawizard - #131

Merged
gsaluja9 merged 24 commits into
developfrom
feature/datawizard
Nov 19, 2022
Merged

gsaluja9 merged 24 commits into
developfrom
feature/datawizard

Conversation

@gsaluja9

Copy link
Copy Markdown
Contributor

No description provided.

@gsaluja9
gsaluja9 force-pushed the feature/datawizard branch from 3391ac8 to 7a42bcc Compare August 31, 2022 18:15
@gsaluja9
gsaluja9 force-pushed the feature/datawizard branch 4 times, most recently from 7832d2e to db2f2ee Compare September 13, 2022 21:02
@luisremis
luisremis self-requested a review October 21, 2022 04:25
Comment thread .vscode/settings.json Resolved
Comment thread test/test_Datawizard.py Resolved
Comment thread test/conftest.py Resolved
Comment thread aperturedb/Sort.py Resolved
Comment thread aperturedb/Operations.py Resolved
Comment thread aperturedb/ParallelQuery.py Resolved
Comment thread aperturedb/ParallelQuery.py Outdated
for k in req:
# Ref to https://docs.aperturedata.io/parameters/blobs.html
blobs_where_default_true = \
k in ["FindImage", "FindBlob", "FindBlobs"] and (

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.

Suggested change
k in ["FindImage", "FindBlob", "FindBlobs"] and (
k in ["FindImage", "FindBlob"] and (

There is no "FindBlobs" command.

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 pending

Comment thread aperturedb/ParallelQuery.py Resolved
Comment thread aperturedb/Query.py Resolved
@gsaluja9
gsaluja9 force-pushed the feature/datawizard branch 2 times, most recently from b849af8 to 5d53419 Compare October 28, 2022 19:31
@gsaluja9
gsaluja9 requested a review from luisremis October 28, 2022 19:44
It addresses a bug in reponse handler that called a batch with partial objects with empty values, as it was based on batchsize value.

Added tests for the same.
Incorporated review comments.
Also includes changes for making response handler more
robust.

Introduces pytest fixtures (using conftest.py) to write more
mantainable code for tests.

Adrresses the parallelizer's logic to take into account the batchsize
while making queries.
luisremis
luisremis previously approved these changes Nov 17, 2022
Comment thread aperturedb/Entities.py
Comment on lines +102 to +114
{
self.find_command: {
"_ref": 1,
"constraints": {
"_uniqueid": ["==", entity["_uniqueid"]]
}
}
}, {
self.update_command: {
"ref": 1,
"properties": properties
}
}

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.

Suggested change
{
self.find_command: {
"_ref": 1,
"constraints": {
"_uniqueid": ["==", entity["_uniqueid"]]
}
}
}, {
self.update_command: {
"ref": 1,
"properties": properties
}
}
{
self.update_command: {
"constraints": {
"_uniqueid": ["==", entity["_uniqueid"]]
},
"properties": properties
}
}

because we update only based on constraints, we don't need to do a find, we can just constraint on update_command

Comment thread test/test_Datawizard.py
Comment on lines +64 to +65
assert images != None

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.

Suggested change
assert images != None
assert images != None
assert len(images) <= 10

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.

will do.

Comment thread test/test_Datawizard.py
Comment on lines +74 to +75
assert blobs != None

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.

Suggested change
assert blobs != None
assert blobs != None
assert len(blobs) <= 10

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.

ok

Comment thread test/test_Datawizard.py
assert isinstance(
bboxes, BoundingBoxes), f"bboxes is not an instance of BoundingBoxes = {bboxes}"
logger.info(f"\n{bboxes.inspect()}")
assert bboxes != None

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.

Suggested change
assert bboxes != None
assert bboxes != None
assert len(bboxes) <= 10

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.

ok

Comment thread examples/similarity_search/add_faces.py Outdated

loader = ParallelLoader.ParallelLoader(dbinfo.create_connector())
loader.ingest(dataset, stats=True)
loader.ingest(dataset, stats=True, numthreads=1, batchsize=1)

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.

why this? we should be able to run ingestion in parallel, it should be much faster.

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.

you are right . will revert.

Comment thread aperturedb/Images.py Outdated

query["FindImage"]["results"]["list"] = []
query["FindImage"]["results"]["list"].append(self.img_id_prop)
# query["FindImage"]["results"]["list"].append("image_size")

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.

Suggested change
# query["FindImage"]["results"]["list"].append("image_size")

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.

will do.

Comment thread aperturedb/Images.py Outdated

for ent in entities:
self.images_ids.append(ent[self.img_id_prop])
# self.images_sizes.append(int(ent["image_size"]))

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.

Suggested change
# self.images_sizes.append(int(ent["image_size"]))

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.

will do

Comment thread aperturedb/Images.py Outdated

if index >= len(self.images_ids):
print("Index is incorrect")
# print("Index is incorrect")

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.

Suggested change
# print("Index is incorrect")

or throw?

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.

will leave print for now. will address it on need basis.

"from aperturedb import Connector\n",
"from aperturedb.Images import Images\n",
"\n",
"db = Connector.Connector(user=\"admin\", password=\"admin\", port=55557)\n",

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.

I think we should always use dbinfo.create_connector() in the examples, so that people follow that convention.
we would need to add a link to dbinfo.py here, like in the other example folders.

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 comment is applicable to all cells in the notebook.

@@ -0,0 +1,758 @@
{

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.

I checked this file as a notebook, and it does not have the results for each cell. do you think we should add the results so that people can see them? I think we do that on other example notebooks.

@gsaluja9
gsaluja9 merged commit b310f3d into develop Nov 19, 2022
@gsaluja9
gsaluja9 deleted the feature/datawizard branch February 7, 2024 16:29
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