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

Cv2 3833 compute and save sscd embeddings for images #47

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

Conversation

ahmednasserswe
Copy link
Contributor

@ahmednasserswe ahmednasserswe commented Oct 31, 2023

@ahmednasserswe please provide a full description here including how this was tested. Note that we still need to add unit tests for SSCD.

Three requests I've used to test locally:

curl -X POST "http://localhost:8000/process_item/image_sscd__Model" \
     -H "Content-Type: application/json" \
     -d '{
           "id": "item123",
           "callback_url": "https://example.com/callback",
           "url": "https://upload.wikimedia.org/wikipedia/commons/b/b5/Ryan_blaney_%2852866797550%29_%28cropped%29.jpg",
           "raw": {"some_key": "some_value"}
         }'
         
curl -X POST "http://localhost:8000/process_item/audio__Model" \
     -H "Content-Type: application/json" \
     -d '{
           "id": "item123",
           "callback_url": "https://example.com/callback",
           "url": "https://upload.wikimedia.org/wikipedia/commons/6/65/Star_Spangled_Banner_instrumental.ogg",
           "raw": {"some_key": "some_value"}
         }'

curl -X POST "http://localhost:8000/process_item/image_pdq__Model" \
     -H "Content-Type: application/json" \
     -d '{
           "id": "item123",
           "callback_url": "https://example.com/callback",
           "url": "https://upload.wikimedia.org/wikipedia/commons/b/b5/Ryan_blaney_%2852866797550%29_%28cropped%29.jpg",
           "raw": {"some_key": "some_value"}
         }'

Copy link
Contributor

@skyemeedan skyemeedan left a comment

Choose a reason for hiding this comment

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

Pretty cool to see a new model deployed! I think it would be really helpful to have a basic test for this? Like 3 images, two are expected to have embeddings match and one that doesn't?

Dockerfile Outdated Show resolved Hide resolved
lib/model/image_sscd.py Outdated Show resolved Hide resolved
lib/model/image_sscd.py Show resolved Hide resolved
lib/model/image_sscd.py Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
lib/model/image_sscd.py Outdated Show resolved Hide resolved
class Model(GenericImageModel):
def __init__(self):
super().__init__()
#FIXME: Load from a Meedan S3 bucket

Choose a reason for hiding this comment

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

This is still to do

@computermacgyver
Copy link

computermacgyver commented Nov 11, 2023

Currently failing due to a Docker issue

#1 pulling image moby/buildkit:buildx-stable-1
#1 pulling image moby/buildkit:buildx-stable-1 5.7s done
#1 ERROR: Error response from daemon: Get "https://registry-1.docker.io/v2/": EOF

It's building and working fine locally because this image is cached.

Before we merge this, we need to write tests for SSCD. Can you please look at test/lib/model/test_image_pdq.py and create similar tests for SSCD @ahmednasserswe ? 🙏

@computermacgyver
Copy link

@DGaffney This was not merged before the refactor. Can you please review? We'd like to get this added to Presto after the next deploy. The conflicts with image and test_image should be minor. Those files are just renamed to have pdq in them since image is too generic. We want the specific model names to be clear what models we're using as we change them.

@DGaffney
Copy link
Collaborator

@DGaffney This was not merged before the refactor. Can you please review? We'd like to get this added to Presto after the next deploy. The conflicts with image and test_image should be minor. Those files are just renamed to have pdq in them since image is too generic. We want the specific model names to be clear what models we're using as we change them.

I can take a look this week.

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.

None yet

4 participants