Skip to content

Commit ed3899e

Browse files
committed
add og images
1 parent 27fccd0 commit ed3899e

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

assess.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
from watchdog.observers import Observer
1111
from watchdog.events import FileSystemEventHandler
1212
import time
13+
from urllib.parse import quote_plus
1314

14-
import cv2
15-
import numpy as np
16-
import supervision as sv
1715
from jinja2 import Environment, FileSystemLoader
18-
from supervision.detection.utils import box_iou_batch
1916
from tqdm import tqdm
2017
from itertools import combinations
2118

@@ -499,6 +496,13 @@ def run_model_with_prompt(model_name, model, assessment):
499496
by_category_results=result_assessments_by_model_by_category[model_name],
500497
average_time=average_times_by_model[model_name],
501498
title=f"{model_name} Results - Vision AI Checkup",
499+
description=f"Explore the results of {model_name} on various vision tasks, from object understanding to document question answering.",
500+
og_image="https://visioncheckup.com" + quote_plus(
501+
os.path.join(
502+
OUTPUT_DIR,
503+
f"{slugify(model_name)}",
504+
)
505+
),
502506
)
503507
)
504508

@@ -554,6 +558,10 @@ def delete_bytes(obj):
554558
for category in assessment_categories
555559
},
556560
title="Prompts | Vision AI Checkup",
561+
description="Explore prompts used to evaluate various vision models on different tasks.",
562+
og_image="https://visioncheckup.com" + quote_plus(
563+
os.path.join(OUTPUT_DIR, "prompts/index.html")
564+
),
557565
)
558566

559567
with open(os.path.join(OUTPUT_DIR, "prompts/index.html"), "w") as file:
@@ -595,6 +603,14 @@ def delete_bytes(obj):
595603
failed_count=sum(1 for result in model_results if not result["correct"]),
596604
total_count=len(model_results),
597605
title=f"{assessment['assessment_name']} - Vision AI Checkup",
606+
description=f"View the results of {assessment['assessment_name']} when run against various SOTA vision models."
607+
og_image="https://visioncheckup.com" + quote_plus(
608+
os.path.join(
609+
OUTPUT_DIR,
610+
"assessments",
611+
slugify(assessment["assessment_name"]),
612+
)
613+
),
598614
)
599615
os.makedirs(
600616
os.path.join(OUTPUT_DIR, "assessments", slugify(assessment["assessment_name"])),
@@ -690,7 +706,10 @@ def delete_bytes(obj):
690706
by_category_results=by_category_results,
691707
assessments=assessments,
692708
title=f"{model1} vs {model2} - Vision AI Checkup",
693-
description=f"See how {model1} and {model2} compare on defect detection, document understanding, VQA, and more."
709+
description=f"See how {model1} and {model2} compare on defect detection, document understanding, VQA, and more.",
710+
og_image="https://v1.screenshot.11ty.dev/" + quote_plus(
711+
f"https://visioncheckup.com/compare/{slugify(model1)}-vs-{slugify(model2)}/"
712+
),
694713
)
695714

696715
os.makedirs(os.path.join(OUTPUT_DIR, "compare"), exist_ok=True)

templates/base.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
<meta name="og:description" content="See how LLMs, foundation models, and VLMs do on vision tasks.">
1818
{% endif %}
1919

20-
<meta name="og:image" content="https://v1.screenshot.11ty.dev/{{ url }}/large/">
20+
{% if og_image %}
21+
<meta name="og:image" content="{{ og_image }}/opengraph/">
22+
{% else %}
23+
<meta name="og:image" content="https://v1.screenshot.11ty.dev/{{ url }}/opengraph/">
24+
{% endif %}
2125

2226
<meta name="twitter:card" content="summary_large_image">
2327

0 commit comments

Comments
 (0)