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

Similarity Search & Embeddings Tutorial Not Working #332

Open
georgesphicas opened this issue Nov 11, 2024 · 2 comments
Open

Similarity Search & Embeddings Tutorial Not Working #332

georgesphicas opened this issue Nov 11, 2024 · 2 comments

Comments

@georgesphicas
Copy link

I've been trying to get the NAIP Inference and Similarity Search with Clay tutorial to work in my environment, but I am running into problems.

I was wondering if I could please have some help getting them to work? If it helps, the part of the similarity search that I am getting stuck on is with the iteration through the chips step. When I run this block of code in my jupyter notebook, I get the following output:

Asset height 247 is not a multiple of highest resolution height 12270.
Image

We've tried to resive the target width and height and we continue to get the same error.

Do the images have to be of a certain size/resolution for the process to work? If so, do you have insight as to why the tutorial fails even when following each step as it's written?

@srmsoumya
Copy link
Collaborator

Thanks for starting this thread @georgesphicas - Can you link to the tutorial notebook you are trying & the step at which you are facing the issue please?

@georgesphicas
Copy link
Author

Hello @srmsoumya ,

the tutorial notebook I am trying is https://clay-foundation.github.io/model/tutorials/v1-inference-simsearch-naip-stacchip.html

the step that has the issue is this one:
for item in items_list[:2]:
print(f"Working on {item}")

# Index the chips in the item
indexer = NoStatsChipIndexer(item)

# Obtain the item bounds and centroid
bounds, centroid_x, centroid_y = get_bounds_centroid(item.assets["image"].href)
print(
    f"Bbox coordinates: {bounds}, centroid coordinates: {centroid_x}, {centroid_y}"
)

# Instantiate the chipper
chipper = Chipper(indexer, asset_blacklist=["metadata"])

# Get 5 randomly sampled chips from the total
# number of chips within this item's entire image
for chip_id in random.sample(range(0, len(chipper)), 5):
    chip_images.append(chipper[chip_id]["image"])
    chip_bounds.append(bounds)

Thank you!

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

No branches or pull requests

2 participants