Download outreach-agent/utils/counterfeit_dashboard.html from Org-Exp/tokenizer: direct link, hf CLI and curl.
- Browser
- Download file 20.4 kB
-
https://huggingface.co/datasets/Org-Exp/tokenizer/resolve/main/outreach-agent/utils/counterfeit_dashboard.html
- Command line
-
hf download hf://datasets/Org-Exp/tokenizer/outreach-agent/utils/counterfeit_dashboard.html
-
curl -L -o counterfeit_dashboard.html https://huggingface.co/datasets/Org-Exp/tokenizer/resolve/main/outreach-agent/utils/counterfeit_dashboard.html
20.4 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Counterfeit review — Gucci</title> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Jost:wght@500;600;700&display=swap" rel="stylesheet"> | |
| <style> | |
| :root { | |
| --bg: #0b0b0f; | |
| --panel: #15151d; | |
| --text-primary: #f5f5f7; | |
| --text-secondary: #b9b9c3; | |
| --border: rgba(255,255,255,0.08); | |
| --fake: #f25c54; | |
| --real: #3fb984; | |
| --review: #f5b700; | |
| --accent: #d9b54c; | |
| } | |
| * { box-sizing: border-box; } | |
| html, body { margin: 0; padding: 0; background: radial-gradient(circle at top, #1a1a24, var(--bg)); color: var(--text-primary); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif; line-height: 1.6; } | |
| main { max-width: 1180px; margin: 0 auto; padding: 48px 24px 80px; display: flex; flex-direction: column; gap: 32px; } | |
| header { display: flex; flex-direction: column; gap: 12px; } | |
| .eyebrow { text-transform: uppercase; letter-spacing: 0.32em; font-size: 11px; color: var(--accent); } | |
| h1 { font-family: Jost, Inter, sans-serif; font-weight: 600; font-size: clamp(32px, 6vw, 64px); margin: 0; } | |
| .intro { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; } | |
| .intro-copy { color: var(--text-secondary); max-width: 720px; margin: 0; } | |
| .data-state { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); font-size: 14px; } | |
| .summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; } | |
| .metric { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%); border: 1px solid var(--border); } | |
| .metric-label { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); } | |
| .metric-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-secondary); box-shadow: 0 0 0 6px rgba(185,185,195,0.12); } | |
| .metric.fake .metric-dot { background: var(--fake); box-shadow: 0 0 0 6px rgba(242,92,84,0.18); } | |
| .metric.real .metric-dot { background: var(--real); box-shadow: 0 0 0 6px rgba(63,185,132,0.16); } | |
| .metric.review .metric-dot { background: var(--review); box-shadow: 0 0 0 6px rgba(245,183,0,0.16); } | |
| .metric-value { font-family: Jost, sans-serif; font-size: clamp(28px, 4vw, 42px); } | |
| .controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); } | |
| .filters { display: flex; flex-wrap: wrap; gap: 10px; } | |
| .filter-button { display: flex; align-items: center; gap: 10px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--text-secondary); padding: 9px 18px; font: 500 14px/1 Inter, sans-serif; cursor: pointer; } | |
| .filter-button[aria-pressed="true"] { background: rgba(217,181,76,0.16); color: var(--text-primary); } | |
| .filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; padding: 0 8px; border-radius: 999px; background: rgba(255,255,255,0.06); font-size: 13px; } | |
| .tools { display: flex; flex-wrap: wrap; gap: 12px; } | |
| .search, .sort { border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-primary); padding: 9px 18px; font: 400 14px/1 Inter, sans-serif; } | |
| .search::placeholder { color: rgba(185,185,195,0.7); } | |
| .results-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; color: var(--text-secondary); font-size: 14px; } | |
| .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; } | |
| .post { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%); border: 1px solid var(--border); box-shadow: 0 40px 60px -60px rgba(217,181,76,0.4); } | |
| .photo { position: relative; aspect-ratio: 4 / 5; background: radial-gradient(circle at top, rgba(255,255,255,0.04), transparent); } | |
| .photo img { width: 100%; height: 100%; object-fit: cover; display: block; } | |
| .status-pill { position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(12px) saturate(120%); background: rgba(11,11,15,0.7); border: 1px solid rgba(255,255,255,0.16); font-size: 13px; text-transform: uppercase; letter-spacing: 0.18em; } | |
| .status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; } | |
| .status-pill.counterfeit::before { background: var(--fake); box-shadow: 0 0 0 6px rgba(242,92,84,0.18); } | |
| .status-pill.real::before { background: var(--real); box-shadow: 0 0 0 6px rgba(63,185,132,0.18); } | |
| .status-pill.review::before { background: var(--review); box-shadow: 0 0 0 6px rgba(245,183,0,0.18); } | |
| .content { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px 24px; } | |
| .meta-row { display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary); font-size: 14px; } | |
| .seller { color: var(--text-primary); } | |
| .caption { margin: 0; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; } | |
| .reason { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,0.01); border: 1px solid var(--border); } | |
| .reason-label { text-transform: uppercase; letter-spacing: 0.24em; font-size: 11px; color: var(--accent); } | |
| .reason-text { margin: 0; color: var(--text-primary); } | |
| .footer { display: flex; align-items: center; justify-content: space-between; } | |
| .date { color: var(--text-secondary); font-size: 14px; } | |
| .source { color: var(--accent); text-decoration: none; font-weight: 500; } | |
| .source[aria-disabled="true"] { pointer-events: none; opacity: 0.4; } | |
| .load-more-wrap { display: flex; justify-content: center; } | |
| .load-more { border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-primary); padding: 11px 28px; font: 500 14px/1 Inter, sans-serif; cursor: pointer; } | |
| .empty { grid-column: 1 / -1; text-align: center; padding: 40px 20px; color: var(--text-secondary); border-radius: 16px; border: 1px dashed var(--border); } | |
| .notice { padding: 14px 18px; border-radius: 12px; background: rgba(245,183,0,0.14); border: 1px solid rgba(245,183,0,0.4); color: var(--text-primary); } | |
| .disclaimer { text-align: center; color: var(--text-secondary); font-size: 14px; } | |
| @media (max-width: 720px) { | |
| .controls { flex-direction: column; align-items: stretch; } | |
| .tools { flex-direction: column; align-items: stretch; } | |
| .search, .sort { width: 100%; } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <main> | |
| <header> | |
| <span class="eyebrow">Gucci / Image-led screening</span> | |
| <h1>Counterfeit review</h1> | |
| <p class="intro-copy">Review the model’s image-based screening across sources.</p> | |
| </header> | |
| <section class="controls" aria-label="Source selection"> | |
| <div class="filters" role="group" aria-label="Source"> | |
| <button class="filter-button" data-source="instagram" aria-pressed="true">Instagram <span class="filter-count" id="srcInstagram">0</span></button> | |
| <button class="filter-button" data-source="flipkart" aria-pressed="false">Flipkart <span class="filter-count" id="srcFlipkart">0</span></button> | |
| </div> | |
| <div class="data-state" id="dataState">Loading results…</div> | |
| </section> | |
| <section class="summary" aria-label="Classification summary"> | |
| <div class="metric"><span class="metric-label">Total items</span><strong class="metric-value" id="countAll">—</strong></div> | |
| <div class="metric fake"><span class="metric-label"><i class="metric-dot"></i>Counterfeit</span><strong class="metric-value" id="countFake">—</strong></div> | |
| <div class="metric real"><span class="metric-label"><i class="metric-dot"></i>Not counterfeit</span><strong class="metric-value" id="countReal">—</strong></div> | |
| <div class="metric review"><span class="metric-label"><i class="metric-dot"></i>Needs review</span><strong class="metric-value" id="countReview">—</strong></div> | |
| </section> | |
| <section class="controls" aria-label="Filters and search"> | |
| <div class="filters" role="group" aria-label="Classification filter"> | |
| <button class="filter-button" data-filter="all" aria-pressed="true">All <span class="filter-count" id="tabAll">0</span></button> | |
| <button class="filter-button" data-filter="counterfeit" aria-pressed="false">Counterfeit <span class="filter-count" id="tabFake">0</span></button> | |
| <button class="filter-button" data-filter="real" aria-pressed="false">Not counterfeit <span class="filter-count" id="tabReal">0</span></button> | |
| <button class="filter-button" data-filter="review" aria-pressed="false">Needs review <span class="filter-count" id="tabReview">0</span></button> | |
| </div> | |
| <div class="tools"> | |
| <label class="search-wrap"><input class="search" id="search" type="search" placeholder="Search caption, seller, ID" aria-label="Search"></label> | |
| <select class="sort" id="sort" aria-label="Sort"> | |
| <option value="recent">Newest</option> | |
| <option value="likes">Most liked</option> | |
| <option value="oldest">Oldest</option> | |
| </select> | |
| </div> | |
| </section> | |
| <div class="results-line"><span id="resultCount">Loading…</span><span>Local image · original source link</span></div> | |
| <div class="notice" id="notice" hidden></div> | |
| <section class="grid" id="grid" aria-live="polite"></section> | |
| <div class="load-more-wrap"><button class="load-more" id="loadMore" hidden>Load more</button></div> | |
| <p class="disclaimer">Automated screening is not definitive authentication. Treat the model’s label and rationale as a review aid, not a final finding.</p> | |
| </main> | |
| <script> | |
| const SOURCES = { | |
| instagram: { url: "data/instagram/gucci_images/gucci_counterfeit_results.json", type: "instagram", countId: "srcInstagram" }, | |
| flipkart: { url: "data/flipkart/gucci/gucci_counterfeit_results.json", type: "flipkart", countId: "srcFlipkart" } | |
| }; | |
| const PAGE_SIZE = 36; | |
| let items = []; | |
| let activeSource = "instagram"; | |
| let activeFilter = "all"; | |
| let page = 1; | |
| const escapeText = (value) => String(value ?? ""); | |
| const statusOf = (item) => { | |
| if (item.classificationError || typeof item.counterfeit !== "boolean") return "review"; | |
| return item.counterfeit ? "counterfeit" : "real"; | |
| }; | |
| const statusLabel = (status) => ({ counterfeit: "Counterfeit signal", real: "Not counterfeit", review: "Needs review" })[status]; | |
| function getImageSrc(item, type) { | |
| if (type === "instagram") { | |
| const local = item.displayUrlLocalPath || item.local_image || ""; | |
| if (!local) return item.displayUrl || ""; | |
| if (local.startsWith("http")) return local; | |
| if (local.includes("/")) return local.startsWith("data/") ? local : "data/" + local.replace(/^\.\//, ""); | |
| return "data/instagram/gucci_images/" + local; | |
| } else { | |
| const local = item.local_image || ""; | |
| if (local) return "data/flipkart/gucci/" + local; | |
| return item.image_url || ""; | |
| } | |
| } | |
| function normalize(item, type) { | |
| if (type === "instagram") { | |
| return { | |
| id: item.id, | |
| caption: item.caption || "", | |
| ownerUsername: item.ownerUsername, | |
| ownerFullName: item.ownerFullName, | |
| url: item.url || item.inputUrl || "#", | |
| image: getImageSrc(item, type), | |
| timestamp: item.timestamp, | |
| likesCount: item.likesCount || 0, | |
| reason: item.classificationError || item.counterfeitReason || "", | |
| counterfeit: item.counterfeit, | |
| classificationError: item.classificationError | |
| }; | |
| } else { | |
| return { | |
| id: item.id, | |
| caption: item.title || "", | |
| ownerUsername: item.brand, | |
| ownerFullName: item.brand, | |
| url: item.url || "#", | |
| image: getImageSrc(item, type), | |
| timestamp: item.fetched_at, | |
| likesCount: 0, | |
| reason: item.counterfeitReason || "", | |
| counterfeit: item.counterfeit, | |
| classificationError: null | |
| }; | |
| } | |
| } | |
| function createCard(item) { | |
| const status = statusOf(item); | |
| const article = document.createElement("article"); | |
| article.className = "post"; | |
| const photo = document.createElement("div"); | |
| photo.className = "photo"; | |
| const image = document.createElement("img"); | |
| image.loading = "lazy"; | |
| image.alt = `Image from ${escapeText(item.ownerUsername || "listing")}`; | |
| image.src = item.image; | |
| image.onerror = () => { image.remove(); }; | |
| const pill = document.createElement("span"); | |
| pill.className = `status-pill ${status}`; | |
| pill.textContent = statusLabel(status); | |
| photo.append(image, pill); | |
| const content = document.createElement("div"); | |
| content.className = "content"; | |
| const meta = document.createElement("div"); | |
| meta.className = "meta-row"; | |
| const seller = document.createElement("span"); | |
| seller.className = "seller"; | |
| seller.textContent = item.ownerUsername ? (activeSource === "instagram" ? `@${item.ownerUsername}` : item.ownerUsername) : "Listing"; | |
| const postId = document.createElement("span"); | |
| postId.textContent = item.id ? `ID ${item.id}` : ""; | |
| meta.append(seller, postId); | |
| const caption = document.createElement("p"); | |
| caption.className = "caption"; | |
| caption.textContent = item.caption || "No caption provided."; | |
| const reason = document.createElement("div"); | |
| reason.className = "reason"; | |
| const reasonLabel = document.createElement("span"); | |
| reasonLabel.className = "reason-label"; | |
| reasonLabel.textContent = "Model rationale"; | |
| const reasonText = document.createElement("p"); | |
| reasonText.className = "reason-text"; | |
| reasonText.textContent = item.reason || "No rationale returned."; | |
| reason.append(reasonLabel, reasonText); | |
| const footer = document.createElement("div"); | |
| footer.className = "footer"; | |
| const date = document.createElement("span"); | |
| date.className = "date"; | |
| date.textContent = item.timestamp ? new Date(item.timestamp).toLocaleDateString() : "Date unavailable"; | |
| const source = document.createElement("a"); | |
| source.className = "source"; | |
| source.href = item.url || "#"; | |
| source.target = "_blank"; | |
| source.rel = "noopener"; | |
| source.textContent = "View original"; | |
| if (!item.url || item.url === "#") source.setAttribute("aria-disabled", "true"); | |
| footer.append(date, source); | |
| content.append(meta, caption, reason, footer); | |
| article.append(photo, content); | |
| return article; | |
| } | |
| function getVisible() { | |
| const q = document.getElementById("search").value.toLowerCase().trim(); | |
| const sort = document.getElementById("sort").value; | |
| let list = items.slice(); | |
| if (activeFilter !== "all") list = list.filter((i) => statusOf(i) === activeFilter); | |
| if (q) { | |
| list = list.filter((i) => [i.caption, i.ownerUsername, i.id, i.reason].some((v) => String(v||"").toLowerCase().includes(q))); | |
| } | |
| list.sort((a,b) => { | |
| if (sort === "likes") return (b.likesCount||0)-(a.likesCount||0); | |
| const at = Date.parse(a.timestamp||"")||0, bt = Date.parse(b.timestamp||"")||0; | |
| return sort === "oldest" ? at-bt : bt-at; | |
| }); | |
| return list; | |
| } | |
| function render() { | |
| const grid = document.getElementById("grid"); | |
| const visible = getVisible(); | |
| const shown = visible.slice(0, page*PAGE_SIZE); | |
| grid.replaceChildren(); | |
| if (!shown.length) { | |
| const empty = document.createElement("div"); | |
| empty.className = "empty"; | |
| empty.textContent = "No items match these filters."; | |
| grid.append(empty); | |
| } else { | |
| const frag = document.createDocumentFragment(); | |
| shown.forEach((i) => frag.append(createCard(i))); | |
| grid.append(frag); | |
| } | |
| document.getElementById("resultCount").textContent = `Showing ${shown.length} of ${visible.length} matching items`; | |
| document.getElementById("loadMore").hidden = shown.length >= visible.length; | |
| } | |
| function updateCounts() { | |
| const c = items.filter((i)=>statusOf(i)==="counterfeit").length; | |
| const r = items.filter((i)=>statusOf(i)==="real").length; | |
| const rev = items.length-c-r; | |
| document.getElementById("countAll").textContent = items.length.toLocaleString(); | |
| document.getElementById("countFake").textContent = c.toLocaleString(); | |
| document.getElementById("countReal").textContent = r.toLocaleString(); | |
| document.getElementById("countReview").textContent = rev.toLocaleString(); | |
| document.getElementById("tabAll").textContent = items.length; | |
| document.getElementById("tabFake").textContent = c; | |
| document.getElementById("tabReal").textContent = r; | |
| document.getElementById("tabReview").textContent = rev; | |
| } | |
| const sourceCounts = { instagram: 0, flipkart: 0 }; | |
| async function loadSource(src) { | |
| activeSource = src; | |
| const cfg = SOURCES[src]; | |
| document.getElementById("dataState").textContent = "Loading…"; | |
| document.getElementById("grid").replaceChildren(); | |
| try { | |
| const res = await fetch(cfg.url, {cache:"no-store"}); | |
| if (!res.ok) throw new Error(`Failed to load ${cfg.url}`); | |
| const data = await res.json(); | |
| const raw = Array.isArray(data.posts) ? data.posts : (Array.isArray(data.products) ? data.products : []); | |
| sourceCounts[src] = raw.length; | |
| document.getElementById(cfg.countId).textContent = raw.length; | |
| items = raw.map((it)=>normalize(it, cfg.type)); | |
| const classified = data.classified_posts || data.classified_products || items.length; | |
| const sourceCount = data.source_posts || data.source_products || items.length; | |
| document.getElementById("dataState").textContent = `${classified.toLocaleString()} classified / ${sourceCount.toLocaleString()} source`; | |
| const err = data.classification_errors; | |
| const notice = document.getElementById("notice"); | |
| if (err) { notice.hidden=false; notice.textContent = `${err} item(s) could not be classified and are marked "Needs review".`; } | |
| else notice.hidden=true; | |
| page=1; | |
| updateCounts(); | |
| render(); | |
| } catch(e) { | |
| document.getElementById("dataState").textContent = "Error"; | |
| const grid = document.getElementById("grid"); | |
| grid.replaceChildren(); | |
| const m = document.createElement("div"); | |
| m.className="empty"; | |
| m.textContent = e.message; | |
| grid.append(m); | |
| } | |
| } | |
| document.querySelectorAll('[data-source]').forEach((b)=>{ | |
| b.addEventListener('click', ()=>{ | |
| document.querySelectorAll('[data-source]').forEach(x=>x.setAttribute('aria-pressed', String(x===b))); | |
| loadSource(b.dataset.source); | |
| }); | |
| }); | |
| document.querySelectorAll('[data-filter]').forEach((b)=>{ | |
| b.addEventListener('click', ()=>{ | |
| activeFilter=b.dataset.filter; page=1; | |
| document.querySelectorAll('[data-filter]').forEach(x=>x.setAttribute('aria-pressed', String(x===b))); | |
| render(); | |
| }); | |
| }); | |
| document.getElementById('search').addEventListener('input', ()=>{page=1;render();}); | |
| document.getElementById('sort').addEventListener('change', render); | |
| document.getElementById('loadMore').addEventListener('click', ()=>{page+=1;render();}); | |
| loadSource('instagram'); | |
| </script> | |
| </body> | |
| </html> | |