Skip to content

Conversation

mansi-k
Copy link
Contributor

@mansi-k mansi-k commented Nov 19, 2024

Comment on lines 80 to 85
resp = self.model.predict(img_inputs)

new_elements = []
for i, element in enumerate(resp.outputs):
summary = ""
if image_elements[i].text:

Choose a reason for hiding this comment

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

are we sure that the index of image in image_elements is same as in resp.outputs?

Comment on lines 29 to +30
image_data = meta.pop('image_base64', None)
id = meta.get('input_id', None)

Choose a reason for hiding this comment

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

QQ: why are we adding this new field ID and will it be used?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is to identify the corresponding summary that was generated for the images in the PDF!

Copy link
Contributor

@sanjaychelliah sanjaychelliah left a comment

Choose a reason for hiding this comment

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

Great addition! Left some comments!

new_elements = []
for i, element in enumerate(resp.outputs):
summary = ""
if image_elements[i].text:
Copy link
Contributor

@sanjaychelliah sanjaychelliah Nov 20, 2024

Choose a reason for hiding this comment

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

I believe image elements will not have text, so why this check here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I observed that some image elements had text too... it can be seen in the output of 9th cell in this notebook

""" Summarizes image elements. """

def __init__(self,
pat,
Copy link
Contributor

Choose a reason for hiding this comment

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

PAT can be optional, if not passed, the Clarifai SDK itself will check in env and return a error if is not set in env.

Copy link
Contributor

@sanjaychelliah sanjaychelliah left a comment

Choose a reason for hiding this comment

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

👍

@mansi-k mansi-k merged commit 17a6230 into main Nov 22, 2024
8 checks passed
@sanjaychelliah sanjaychelliah mentioned this pull request Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants