Unverified Commit 2f16a45d authored by Ibrahim Amin's avatar Ibrahim Amin Committed by GitHub
Browse files

Use unused prepare_img() function in dinov2 conversion script (#31335)

parent 25245ec2
......@@ -138,7 +138,7 @@ def read_in_q_k_v(state_dict, config):
# We will verify our results on an image of cute cats
def prepare_img():
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
return image
......@@ -190,8 +190,7 @@ def convert_dinov2_checkpoint(model_name, pytorch_dump_folder_path, push_to_hub=
model.load_state_dict(state_dict)
# load image
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
image = prepare_img()
# preprocess image
transformations = transforms.Compose(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment