Spaces:
Running
Running
SimReady Library: catalog of projectsim/simready-assets
Browse filesFiles changed (8)
- README.md+56-5
- app.jsAdded+390
- data/catalog.jsonAdded
- index.html+73-17
- style.css+178-22
- tools/build_catalog.pyAdded+236
- tools/groups.jsonAdded+131
- tools/meta_cache.jsonAdded
12345678910---title: Simready Libraryemoji: 🐨colorFrom: bluecolorTo: graysdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061---title: projectsim SimReady Libraryemoji: 📦colorFrom: redcolorTo: graysdk: staticshort_description: Browse projectsim's sim-ready objects for Isaac Simtags:- robotics- simulation- simready- isaac-sim- openusd- articulatedlicense: cc-by-4.0---# projectsim SimReady LibraryBrowse every object in [projectsim/simready-assets](https://huggingface.co/datasets/projectsim/simready-assets):sim-ready OpenUSD assets for NVIDIA Isaac Sim, with physics, moving parts and NVIDIASimReady benchmark results. Filter by category, moving parts, size, mass and NVIDIASimReady Central status, open any asset for its details, and copy the download command.All assets are CC BY 4.0. Credit "projectsim by Kaedim".Need more variations, or your own objects? See the[projectsim API](https://docs.projectsim.ai/getting-started/quickstart?utm_source=hf_space&utm_medium=readme&utm_content=simready-library)or email team@projectsim.ai.## How it worksThe page is static: `index.html`, `app.js` and `style.css` read `data/catalog.json`.Thumbnails and files load straight from the dataset, pinned to the commit the catalogwas built from.`tools/build_catalog.py` builds `data/catalog.json`:- From the dataset, per asset: the package version, the NVIDIA benchmark results, andthe SimReady metadata in the root USD layer (category, Wikidata class, mass, size,rigid bodies, joints, whether the base is fixed to the world).- From [NVIDIA-Omniverse/simready-central](https://github.com/NVIDIA-Omniverse/simready-central),through the `gh` CLI: which packages are merged, and which are in an open PR.- Categories are cleaned up and grouped by `tools/groups.json`.Root USD files are large, so their metadata is cached in `tools/meta_cache.json` bypackage version. A rebuild only downloads new or changed packages.## UpdatingRun this after new packages are uploaded to the dataset, or after an NVIDIA PR isopened or merged:```bashhf download projectsim/simready-library --repo-type space --local-dir simready-librarycd simready-libraryuv run tools/build_catalog.pyhf upload projectsim/simready-library . --repo-type space --commit-message "Update catalog"```If the build warns about a category it can't place, add it to `tools/groups.json`(under `aliases` to rename it, or under `categories` to give it a group) and run it again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390"use strict";// projectsim SimReady Library: a static catalog of data/catalog.json (built by// tools/build_catalog.py). Images and files load straight from the public dataset,// pinned to the commit the catalog was built from.
const HF = "https://huggingface.co";const API_DOCS = "https://docs.projectsim.ai/getting-started/quickstart?utm_source=hf_space&utm_medium=detail&utm_content=simready-library";const CENTRAL = "https://huggingface.co/spaces/nvidia/simready-central";const CENTRAL_PRS = "https://github.com/NVIDIA-Omniverse/simready-central/pull/";
const TESTS = { presence: "Renders", pivot: "Pivot at base", ground_drop: "Ground drop", slope_drop: "Slope drop", joint_movement: "Joints move", normals_xz: "Normals", culling_xz: "Back-face culling", light_response: "Light response", preview_surface_renders: "Preview material", semantic_labels_seg_labelled: "Semantic labels", semantic_labels_seg_stripped: "Labels removable",};
const FACETS = [ { key: "moving", title: "Moving parts", options: [ ["yes", "Has moving parts", (a) => a.joints.length > 0], ["no", "Rigid", (a) => a.joints.length === 0], ] }, { key: "joint", title: "Joint type", options: [ ["hinge", "Hinge", (a) => a.joints.some((j) => j.type === "hinge")], ["slider", "Slider", (a) => a.joints.some((j) => j.type === "slider")], ] }, { key: "size", title: "Size (longest side)", options: [ ["s", "< 15 cm", (a) => maxDim(a) < 0.15], ["m", "15–50 cm", (a) => maxDim(a) >= 0.15 && maxDim(a) < 0.5], ["l", "50 cm–1.5 m", (a) => maxDim(a) >= 0.5 && maxDim(a) < 1.5], ["xl", "1.5 m +", (a) => maxDim(a) >= 1.5], ] }, { key: "mass", title: "Mass", options: [ ["xs", "< 100 g", (a) => a.mass < 0.1], ["s", "100 g–1 kg", (a) => a.mass >= 0.1 && a.mass < 1], ["m", "1–10 kg", (a) => a.mass >= 1 && a.mass < 10], ["l", "10 kg +", (a) => a.mass >= 10], ] }, { key: "mount", title: "Placement", options: [ ["free", "Free-standing", (a) => !a.mounted], ["fixed", "Mounted (fixed base)", (a) => a.mounted], ] }, { key: "nvidia", title: "NVIDIA SimReady Central", options: [ ["merged", "Accepted", (a) => a.nvidia.status === "merged"], ["in_review", "In review", (a) => a.nvidia.status === "in_review"], ["not_submitted", "Not submitted", (a) => a.nvidia.status === "not_submitted"], ] }, { key: "bench", title: "NVIDIA benchmark", options: [ ["pass", "All tests pass", (a) => a.benchmark && a.benchmark.passed], ["issues", "Has known issues", (a) => a.benchmark && !a.benchmark.passed], ] },];
const $ = (id) => document.getElementById(id);const el = (tag, attrs = {}, ...kids) => { const n = document.createElement(tag); for (const [k, v] of Object.entries(attrs)) { if (v == null || v === false) continue; if (k === "class") n.className = v; else if (k.startsWith("on")) n.addEventListener(k.slice(2), v); else n.setAttribute(k, v === true ? "" : v); } for (const k of kids.flat(Infinity)) if (k != null && k !== false) n.append(k.nodeType ? k : String(k)); return n;};
let DATA = null;const state = { q: "", group: null, category: null, facets: {}, sort: "name", asset: null, open: new Set() };const light = window.matchMedia("(prefers-color-scheme: light)");
function maxDim(a) { return a.extents ? Math.max(...a.extents) : 0; }function size(a) { return a.extents ? a.extents.reduce((x, y) => x * y, 1) : 0; }function fmtLen(m) { return m >= 1 ? `${m.toFixed(2)} m` : m >= 0.01 ? `${(m * 100).toFixed(1)} cm` : `${(m * 1000).toFixed(1)} mm`; }function fmtDims(a) { if (!a.extents) return "—"; const unitM = maxDim(a) >= 1; const f = (v) => unitM ? v.toFixed(2) : (v * 100).toFixed(1); return `${a.extents.map(f).join(" × ")} ${unitM ? "m" : "cm"}`;}function fmtMass(kg) { if (kg == null) return "—"; return kg < 1 ? `${+(kg * 1000).toPrecision(3)} g` : `${+kg.toPrecision(4)} kg`;}function fmtRange(j) { if (j.lower == null || j.upper == null || Math.abs(j.upper - j.lower) > 1e6) return j.type === "hinge" ? "spins freely" : "free"; if (j.type === "hinge") return `${Math.round(j.lower)}° to ${Math.round(j.upper)}°`; return `${fmtLen(Math.abs(j.upper - j.lower))} travel`;}const partsLabel = (a) => a.joints.length ? `${a.joints.length} moving part${a.joints.length > 1 ? "s" : ""}` : "Rigid";const cap = (s) => s ? s[0].toUpperCase() + s.slice(1) : s;
function fileUrl(a, path) { return `${HF}/datasets/${DATA.dataset}/resolve/${DATA.commit}/${a.id}/${path}`; }function thumbUrl(a, variant) { const suffix = variant === "light" ? "_light" : variant === "transparent" ? "_transparent" : ""; return fileUrl(a, `simready_usd/.thumbs/256x256/${a.id}.usd${suffix}.png`);}
function matchesQuery(a, words) { if (!words.length) return true; const hay = a._hay || (a._hay = [a.id, a.name, a.class, a.category, a.group, ...a.joints.map((j) => `${j.name} ${j.type}`)] .join(" ").toLowerCase().replace(/_/g, " ")); return words.every((w) => hay.includes(w));}function facetPass(a, skipKey) { for (const f of FACETS) { if (f.key === skipKey) continue; const on = state.facets[f.key]; if (!on || !on.size) continue; if (!f.options.some(([v, , test]) => on.has(v) && test(a))) return false; } return true;}function libraryPass(a) { if (state.category) return a.category === state.category; if (state.group) return a.group === state.group; return true;}function words() { return state.q.toLowerCase().replace(/_/g, " ").split(/\s+/).filter(Boolean); }
function filtered() { const w = words(); const list = DATA.assets.filter((a) => libraryPass(a) && facetPass(a) && matchesQuery(a, w)); const by = { name: (x, y) => x.name.localeCompare(y.name), newest: (x, y) => (y.version || "").localeCompare(x.version || "") || x.name.localeCompare(y.name), "mass-desc": (x, y) => (y.mass || 0) - (x.mass || 0), "mass-asc": (x, y) => (x.mass || 0) - (y.mass || 0), "size-desc": (x, y) => size(y) - size(x), "parts-desc": (x, y) => y.joints.length - x.joints.length || x.name.localeCompare(y.name), }[state.sort]; return list.sort(by);}
// Library tree: counts reflect search and facets, not the library selection itself.function renderLibrary() { const w = words(); const pool = DATA.assets.filter((a) => facetPass(a) && matchesQuery(a, w)); const ul = $("library"); ul.replaceChildren(); const row = (label, n, current, onclick, extra = {}) => el("button", { class: "lib-row", type: "button", "aria-current": current ? "true" : "false", onclick, ...extra, }, extra.caret ? el("span", { class: "caret", "aria-hidden": "true" }, "›") : null, label, el("span", { class: "n" }, n)); ul.append(el("li", {}, row("All assets", pool.length, !state.group && !state.category, () => select(null, null)))); for (const g of DATA.groups) { const inGroup = pool.filter((a) => a.group === g); const total = DATA.assets.some((a) => a.group === g); if (!total) continue; const open = state.open.has(g) || state.group === g; const cats = [...new Set(DATA.assets.filter((a) => a.group === g).map((a) => a.category))].sort(); const li = el("li", {}, row(g, inGroup.length, state.group === g && !state.category, () => { if (state.group === g && !state.category) { state.open.has(g) ? state.open.delete(g) : state.open.add(g); renderLibrary(); return; } state.open.add(g); select(g, null); }, { caret: true, "aria-expanded": open ? "true" : "false" })); if (open) { li.append(el("ul", { class: "lib-sub" }, cats.map((c) => el("li", {}, row(cap(c), inGroup.filter((a) => a.category === c).length, state.category === c, () => select(g, c)))))); } ul.append(li); }}
function renderFacets() { const w = words(); const box = $("facets"); box.replaceChildren(); for (const f of FACETS) { const base = DATA.assets.filter((a) => libraryPass(a) && facetPass(a, f.key) && matchesQuery(a, w)); const on = state.facets[f.key] || new Set(); box.append(el("div", { class: "facet" }, el("h3", {}, f.title), el("div", { class: "facet-opts" }, f.options.map(([v, label, test]) => { const n = base.filter(test).length; return el("button", { class: "opt", type: "button", "aria-pressed": on.has(v) ? "true" : "false", disabled: !n && !on.has(v), onclick: () => toggleFacet(f.key, v), }, label, el("span", { class: "n" }, n)); })))); } const active = Object.values(state.facets).some((s) => s.size) || state.q || state.group; $("reset").hidden = !active;}
function renderChips() { const chips = $("chips"); chips.replaceChildren(); const chip = (label, onclear) => el("span", { class: "chip" }, label, el("button", { type: "button", "aria-label": `Remove ${label}`, onclick: onclear }, "×")); if (state.category) chips.append(chip(cap(state.category), () => select(state.group, null))); else if (state.group) chips.append(chip(state.group, () => select(null, null))); for (const f of FACETS) for (const v of state.facets[f.key] || []) { const opt = f.options.find((o) => o[0] === v); if (opt) chips.append(chip(opt[1], () => toggleFacet(f.key, v))); }}
function renderGrid() { const list = filtered(); const n = DATA.assets.length; $("count").replaceChildren(el("strong", {}, list.length), list.length === n ? " assets" : ` of ${n} assets`); $("empty").hidden = list.length > 0; const variant = light.matches ? "light" : "dark"; $("grid").replaceChildren(...list.map((a) => el("li", {}, el("button", { class: "card", type: "button", "aria-current": state.asset === a.id ? "true" : "false", onclick: () => openAsset(a.id), "data-id": a.id, }, el("div", { class: "thumb" }, el("img", { src: thumbUrl(a, variant), alt: "", loading: "lazy", width: 256, height: 256 }), el("div", { class: "badges" }, el("span", { class: "badge" }, a.joints.length ? `${a.joints.length} joint${a.joints.length > 1 ? "s" : ""}` : "rigid"), a.nvidia.status === "merged" ? el("span", { class: "badge nv", title: "Accepted into NVIDIA SimReady Central" }, "NVIDIA") : a.nvidia.status === "in_review" ? el("span", { class: "badge review", title: "In NVIDIA review" }, "IN REVIEW") : null)), el("div", { class: "card-text" }, el("span", { class: "card-name" }, a.name), el("span", { class: "card-meta" }, `${cap(a.class || a.category)} · ${fmtMass(a.mass)}`))))));}
function benchTable(a) { if (!a.benchmark) return el("p", { class: "note" }, "No benchmark results in this package."); const rows = {}; for (const [t, e, s] of a.benchmark.tests) (rows[t] = rows[t] || {})[e] = s; const res = (s) => { const k = s === "pass" ? "pass" : s === "fail" || s === "error" ? "fail" : s ? "skip" : "none"; return el("span", { class: `res ${k}` }, s ? (s === "skipped" ? "skip" : s) : "–"); }; const order = Object.keys(TESTS).filter((t) => rows[t]).concat(Object.keys(rows).filter((t) => !TESTS[t])); const fails = a.benchmark.tests.filter(([, , s]) => s === "fail" || s === "error").length; return el("div", {}, el("table", { class: "bench" }, el("thead", {}, el("tr", {}, el("th", {}, "Test"), el("th", { class: "r" }, "PhysX"), el("th", { class: "r" }, "Newton"))), el("tbody", {}, order.map((t) => el("tr", {}, el("td", {}, TESTS[t] || t), el("td", { class: "r" }, res(rows[t].physx)), el("td", { class: "r" }, res(rows[t].newton)))))), el("p", { class: "note" }, fails ? `${fails} test${fails > 1 ? "s" : ""} failed. NVIDIA accepts some known benchmark limits (very small objects, dark materials, slopes) when they're disclosed in the submission.` : `All tests passed (Isaac Sim ${a.benchmark.run ? a.benchmark.run.slice(0, 10) : ""}).`));}
function nvidiaStatus(a) { const s = a.nvidia.status; const body = s === "merged" ? ["Accepted into NVIDIA SimReady Central. ", el("a", { href: `${CENTRAL}?q=${encodeURIComponent(a.id.replace(/_/g, " "))}`, target: "_blank", rel: "noopener" }, "Find it there")] : s === "in_review" ? ["In NVIDIA review, ", el("a", { href: CENTRAL_PRS + a.nvidia.pr, target: "_blank", rel: "noopener" }, `PR #${a.nvidia.pr}`)] : ["Not submitted to NVIDIA SimReady Central yet."]; return el("div", { class: `status ${s}` }, el("span", { class: "status-dot", "aria-hidden": "true" }), el("span", {}, body));}
function copyButton(text, label = "Copy") { const b = el("button", { class: "btn", type: "button" }, label); b.addEventListener("click", async () => { try { await navigator.clipboard.writeText(text); b.textContent = "Copied"; } catch { b.textContent = "Select and copy"; } setTimeout(() => (b.textContent = label), 1600); }); return b;}
function renderDetail() { const a = state.asset && DATA.assets.find((x) => x.id === state.asset); const pane = $("detail"); document.querySelector(".layout").classList.toggle("has-detail", !!a); pane.hidden = !a; if (!a) return; let variant = light.matches ? "light" : "dark"; const img = el("img", { src: thumbUrl(a, variant), alt: `${a.name} preview` }); const frame = el("div", { class: `thumb ${variant === "light" ? "light" : ""}` }, img); const bg = (v, label) => el("button", { class: "opt", type: "button", "aria-pressed": v === variant ? "true" : "false", onclick: (e) => { variant = v; img.src = thumbUrl(a, v); frame.className = `thumb ${v === "light" ? "light" : v === "transparent" ? "checker" : ""}`; e.currentTarget.parentNode.querySelectorAll(".opt").forEach((b) => b.setAttribute("aria-pressed", b === e.currentTarget ? "true" : "false")); }, }, label); const cmd = `hf download ${DATA.dataset} --repo-type dataset --include "${a.id}/*" --local-dir simready-assets`; const folder = `${HF}/datasets/${DATA.dataset}/tree/main/${a.id}`; const usd = `${HF}/datasets/${DATA.dataset}/blob/main/${a.id}/simready_usd/${a.id}.usd`; const facts = [ ["Class", a.qcode ? el("a", { href: `https://www.wikidata.org/wiki/${a.qcode}`, target: "_blank", rel: "noopener" }, `${a.class || a.qcode} (${a.qcode})`) : a.class], ["Category", `${a.group} › ${cap(a.category)}`], ["Dimensions", fmtDims(a)], ["Mass", fmtMass(a.mass)], ["Rigid bodies", a.rigid_bodies], ["Moving parts", partsLabel(a)], ["Placement", a.mounted ? "Mounted: base fixed to the world where you place it" : "Free-standing"], ["Physics", "PhysX (Isaac Sim)"], ["Format", `OpenUSD${a.glass ? ", glass MDL shaders included" : ""}`], ["License", "CC BY 4.0 · credit “projectsim by Kaedim”"], ["Version", a.version], ]; $("detail-body").replaceChildren( el("div", {}, el("div", { class: "detail-head" }, el("h2", {}, a.name), el("button", { class: "icon-button", type: "button", "aria-label": "Close details", onclick: () => openAsset(null) }, "×")), el("p", { class: "detail-sub" }, `${cap(a.class || a.category)} · ${partsLabel(a)}`)), el("div", { class: "viewer" }, frame, el("div", { class: "viewer-bar" }, bg("dark", "Dark"), bg("light", "Light"), bg("transparent", "Transparent"))), nvidiaStatus(a), el("dl", { class: "facts" }, facts.map(([k, v]) => [el("dt", {}, k), el("dd", {}, v ?? "—")])), a.joints.length ? el("section", {}, el("h3", { class: "section-title" }, "Moving parts"), el("ul", { class: "parts" }, a.joints.map((j) => el("li", {}, el("code", {}, j.name), el("span", { class: "kind" }, `${j.type}, ${fmtRange(j)}`))))) : null, el("section", {}, el("h3", { class: "section-title" }, "NVIDIA benchmark"), benchTable(a)), el("section", { class: "actions" }, el("h3", { class: "section-title" }, "Get it"), el("div", { class: "cmd" }, el("code", {}, cmd), copyButton(cmd)), el("div", { class: "btn-row" }, el("a", { class: "btn primary", href: folder, target: "_blank", rel: "noopener" }, "Open on Hugging Face"), el("a", { class: "btn", href: usd, target: "_blank", rel: "noopener" }, "USD file"), copyButton(location.href, "Copy link"))), el("section", { class: "more" }, el("p", {}, el("strong", {}, "Need many variations, or your own objects?")), el("p", {}, `projectsim generates sim-ready objects like this ${a.class || "asset"} at scale, with physics and moving parts set up.`), el("div", { class: "btn-row" }, el("a", { class: "btn primary", href: API_DOCS, target: "_blank", rel: "noopener" }, "Generate with the API"), el("a", { class: "btn", href: "mailto:team@projectsim.ai" }, "team@projectsim.ai"))), ); $("detail-body").scrollTop = 0;}
function syncUrl() { const p = new URLSearchParams(); if (state.q) p.set("q", state.q); if (state.group) p.set("g", state.group); if (state.category) p.set("c", state.category); for (const [k, s] of Object.entries(state.facets)) if (s.size) p.set(k, [...s].join(",")); if (state.sort !== "name") p.set("sort", state.sort); if (state.asset) p.set("a", state.asset); const qs = p.toString(); history.replaceState(null, "", qs ? `?${qs}` : location.pathname);}function readUrl() { const p = new URLSearchParams(location.search); state.q = p.get("q") || ""; state.group = p.get("g"); state.category = p.get("c"); state.sort = p.get("sort") || "name"; state.asset = p.get("a"); for (const f of FACETS) if (p.get(f.key)) state.facets[f.key] = new Set(p.get(f.key).split(",")); if (state.group) state.open.add(state.group);}
function refresh() { renderLibrary(); renderFacets(); renderChips(); renderGrid(); syncUrl(); }function select(group, category) { state.group = group; state.category = category; refresh(); closeSideOnPhone(); }function toggleFacet(key, v) { const s = state.facets[key] || (state.facets[key] = new Set()); s.has(v) ? s.delete(v) : s.add(v); refresh();}function openAsset(id) { state.asset = id; renderDetail(); document.querySelectorAll(".card").forEach((c) => c.setAttribute("aria-current", c.dataset.id === id ? "true" : "false")); syncUrl();}function closeSideOnPhone() { if (window.matchMedia("(max-width: 900px)").matches) { $("side").classList.remove("open"); $("filters-toggle").setAttribute("aria-expanded", "false"); }}
async function start() { try { DATA = await (await fetch("data/catalog.json", { cache: "no-cache" })).json(); } catch { $("count").textContent = "The catalog didn't load. Refresh the page to try again."; return; } readUrl(); $("q").value = state.q; $("sort").value = state.sort; $("built").textContent = `${DATA.assets.length} assets · updated ${DATA.built.slice(0, 10)}`; let t; $("q").addEventListener("input", (e) => { clearTimeout(t); t = setTimeout(() => { state.q = e.target.value.trim(); refresh(); }, 120); }); $("sort").addEventListener("change", (e) => { state.sort = e.target.value; refresh(); }); $("reset").addEventListener("click", () => { state.q = ""; $("q").value = ""; state.group = state.category = null; state.facets = {}; refresh(); }); $("filters-toggle").addEventListener("click", () => { const open = $("side").classList.toggle("open"); $("filters-toggle").setAttribute("aria-expanded", open ? "true" : "false"); }); document.addEventListener("keydown", (e) => { if (e.key === "Escape") { if (state.asset) openAsset(null); else closeSideOnPhone(); } if (e.key === "/" && document.activeElement !== $("q")) { e.preventDefault(); $("q").focus(); } }); light.addEventListener("change", () => { renderGrid(); renderDetail(); }); refresh(); renderDetail();}start();12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"><title>projectsim SimReady Library</title><meta name="description" content="Browse projectsim's sim-ready objects for NVIDIA Isaac Sim: categories, physics, moving parts and NVIDIA benchmark results."><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap"><link rel="stylesheet" href="style.css"></head><body><header class="top"><a class="brand" href="./" aria-label="projectsim SimReady Library, reset"><span class="brand-mark" aria-hidden="true"></span><span class="brand-name">projectsim</span><span class="brand-product">SimReady Library</span></a><label class="search"><span class="sr-only">Search assets</span><svg aria-hidden="true" viewBox="0 0 20 20"><path d="M8.5 3a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11Zm0-1.5a7 7 0 1 0 4.2 12.6l3.85 3.85 1.06-1.06-3.85-3.85A7 7 0 0 0 8.5 1.5Z"/></svg><input id="q" type="search" placeholder="Search by name, class or part, e.g. hinge" autocomplete="off"></label><nav class="top-links"><a id="link-dataset" href="https://huggingface.co/datasets/projectsim/simready-assets" target="_blank" rel="noopener">Dataset</a><a class="cta" href="https://docs.projectsim.ai/getting-started/quickstart?utm_source=hf_space&utm_medium=header&utm_content=simready-library" target="_blank" rel="noopener">Generate your own</a></nav><button id="filters-toggle" class="filters-toggle" type="button" aria-controls="side" aria-expanded="false">Filters</button></header><div class="layout"><aside id="side" class="side" aria-label="Library and filters"><section class="side-block"><h2 class="side-title">Library</h2><ul id="library" class="library"></ul></section><section class="side-block"><div class="side-head"><h2 class="side-title">Refine by</h2><button id="reset" class="link-button" type="button" hidden>Reset</button></div><div id="facets"></div></section><p id="built" class="side-foot"></p></aside><main class="results" aria-label="Assets"><div class="results-bar"><p id="count" class="count" role="status" aria-live="polite">Loading assets…</p><div id="chips" class="chips"></div><label class="sort"><span>Sort</span><select id="sort"><option value="name">Name</option><option value="newest">Newest</option><option value="mass-desc">Heaviest</option><option value="mass-asc">Lightest</option><option value="size-desc">Largest</option><option value="parts-desc">Most moving parts</option></select></label></div><ul id="grid" class="grid"></ul><p id="empty" class="empty" hidden>No assets match. Try fewer filters or another word.</p></main><aside id="detail" class="detail" aria-label="Asset details" hidden><div class="detail-scroll" id="detail-body"></div></aside></div><script src="app.js"></script></body></html>
12345678910111213141516171819202122232425262728body {padding: 2rem;font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;}h1 {font-size: 16px;margin-top: 0;}p {color: rgb(107, 114, 128);font-size: 15px;margin-bottom: 10px;margin-top: 5px;}.card {max-width: 620px;margin: 0 auto;padding: 16px;border: 1px solid lightgray;border-radius: 16px;}.card p:last-child {margin-bottom: 0;}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184/* Layout: header, then three panes like a catalog explorer: library + filters (left),asset grid (centre), asset details (right). Dark-first to match the #1A1A1A thumbnails;light theme follows the viewer's system setting. Brand: projectsim warm red accent. */:root {--bg: #121110;--panel: #1a1918;--raised: #232120;--line: #34312e;--ink: #f3eee8;--muted: #a8a099;--faint: #6f6862;--accent: #e2624d;--accent-ink: #ffffff;--accent-soft: rgba(226, 98, 77, 0.16);--pass: #6cc08e;--fail: #e47b6c;--skip: #8c857f;--info: #d9a85b;--thumb: #1a1a1a;--sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;--radius: 10px;color-scheme: dark;}@media (prefers-color-scheme: light) {:root {--bg: #f5f0eb;--panel: #fbf9f4;--raised: #ffffff;--line: #e6ded4;--ink: #2c1a1d;--muted: #6b5d55;--faint: #9a8d84;--accent: #c4473a;--accent-soft: rgba(196, 71, 58, 0.12);--pass: #2f7d4f;--fail: #b23a3a;--skip: #8a8079;--info: #9a6a12;--thumb: #f0f0f0;color-scheme: light;}}* { box-sizing: border-box; }html, body { height: 100%; }body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); display: flex; flex-direction: column; }a { color: inherit; }button, select, input { font: inherit; color: inherit; }:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }[hidden] { display: none !important; }/* Header */.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; white-space: nowrap; }.brand-mark { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); align-self: center; }.brand-name { font-weight: 700; letter-spacing: -0.01em; }.brand-product { color: var(--muted); font-weight: 500; }.search { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; min-width: 0; }.search svg { width: 16px; height: 16px; fill: var(--muted); flex: none; }.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; outline: none; }.top-links { display: flex; gap: 8px; align-items: center; }.top-links a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }.top-links a:hover { color: var(--ink); background: var(--raised); }.top-links a.cta { background: var(--accent); color: var(--accent-ink); }.top-links a.cta:hover { filter: brightness(1.08); color: var(--accent-ink); background: var(--accent); }.filters-toggle { display: none; border: 1px solid var(--line); background: var(--raised); border-radius: 8px; padding: 7px 12px; cursor: pointer; }/* Panes */.layout { flex: 1; display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 0; position: relative; }@media (min-width: 1280px) { .layout.has-detail { grid-template-columns: 260px minmax(0, 1fr) 420px; } }.side { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 14px 12px 20px; display: grid; align-content: start; gap: 18px; }.results { overflow-y: auto; padding: 14px 16px 32px; min-width: 0; }.detail { border-left: 1px solid var(--line); background: var(--panel); min-width: 0; overflow: hidden; display: flex; }@media (max-width: 1279px) { .detail { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 15; box-shadow: -20px 0 40px rgba(0, 0, 0, 0.35); } }.detail-scroll > * { min-width: 0; }.detail-scroll { overflow-y: auto; padding: 16px; display: grid; grid-auto-rows: max-content; gap: 16px; align-content: start; width: 100%; }/* Sidebar */.side-title { margin: 0 0 6px; font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }.side-head { display: flex; justify-content: space-between; align-items: baseline; }.link-button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 12.5px; }.library { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }.lib-row { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 7px; cursor: pointer; color: var(--muted); }.lib-row:hover { background: var(--raised); color: var(--ink); }.lib-row[aria-current="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }.lib-row .n { margin-left: auto; font: 12px var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }.lib-row .caret { width: 14px; flex: none; color: var(--faint); transition: transform 0.15s; }.lib-row[aria-expanded="true"] .caret { transform: rotate(90deg); }.lib-sub { list-style: none; margin: 0 0 4px; padding: 0 0 0 20px; display: grid; gap: 1px; }.lib-sub .lib-row { padding: 4px 8px; font-size: 13px; }.facet { border-top: 1px solid var(--line); padding: 10px 0 4px; }.facet h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }.facet-opts { display: flex; flex-wrap: wrap; gap: 5px; }.opt { border: 1px solid var(--line); background: var(--raised); border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 12.5px; color: var(--muted); }.opt:hover { color: var(--ink); border-color: var(--faint); }.opt[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }.opt .n { opacity: 0.75; font-family: var(--mono); font-size: 11px; margin-left: 3px; }.opt:disabled { opacity: 0.4; cursor: default; }.side-foot { margin: 0; font-size: 12px; color: var(--faint); }/* Results */.results-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }.count { margin: 0; color: var(--muted); }.count strong { color: var(--ink); }.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12.5px; background: var(--raised); }.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 14px; line-height: 1; }.sort { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-left: auto; }.sort select { background: var(--raised); border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; }.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }.card { width: 100%; display: grid; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 0; overflow: hidden; cursor: pointer; transition: border-color 0.12s, transform 0.12s; }.card:hover { border-color: var(--faint); }.card[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }.thumb { position: relative; aspect-ratio: 1; background: var(--thumb); display: grid; place-items: center; }.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }.badges { position: absolute; top: 7px; left: 7px; right: 7px; display: flex; justify-content: space-between; gap: 4px; pointer-events: none; }.badge { font: 600 10.5px/1 var(--mono); letter-spacing: 0.03em; padding: 4px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.62); color: #f3eee8; }.badge.nv { background: #76b900; color: #10200a; }.badge.review { background: rgba(217, 168, 91, 0.92); color: #2a1d06; }.card-text { padding: 9px 10px 10px; display: grid; gap: 2px; min-width: 0; }.card-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.card-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.empty { color: var(--muted); padding: 40px 0; text-align: center; }/* Detail */.detail-head { display: flex; gap: 8px; align-items: start; }.detail-head h2 { margin: 0; font-size: 20px; line-height: 1.2; text-wrap: balance; flex: 1; }.icon-button { border: 1px solid var(--line); background: var(--raised); border-radius: 7px; width: 30px; height: 30px; cursor: pointer; flex: none; color: var(--muted); font-size: 16px; line-height: 1; }.detail-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }.detail-sub a { color: var(--muted); }.viewer { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }.viewer .thumb { aspect-ratio: 4 / 3; }.viewer .thumb.light { background: #f0f0f0; }.viewer .thumb.checker { background: repeating-conic-gradient(#d9d9d9 0 25%, #f4f4f4 0 50%) 0 0 / 18px 18px; }.viewer-bar { display: flex; gap: 4px; padding: 6px; background: var(--raised); border-top: 1px solid var(--line); }.viewer-bar .opt { font-size: 12px; }.status { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--raised); font-size: 13px; }.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--skip); }.status.merged .status-dot { background: #76b900; }.status.in_review .status-dot { background: var(--info); }.status a { color: var(--accent); }.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }.facts dt { color: var(--muted); }.facts dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }.section-title { margin: 0 0 8px; font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }.parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }.parts li { display: flex; gap: 8px; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 4px; }.parts code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }.parts .kind { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }.bench { width: 100%; border-collapse: collapse; font-size: 12.5px; }.bench th, .bench td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }.bench th { color: var(--faint); font-weight: 500; font-size: 11.5px; }.bench td.r { text-align: center; width: 64px; }.res { display: inline-block; min-width: 40px; text-align: center; font: 600 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 4px; }.res.pass { background: rgba(108, 192, 142, 0.16); color: var(--pass); }.res.fail { background: rgba(228, 123, 108, 0.16); color: var(--fail); }.res.skip { background: rgba(140, 133, 127, 0.16); color: var(--skip); }.res.none { color: var(--faint); background: none; }.note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }.actions { display: grid; gap: 8px; }.cmd { display: flex; gap: 6px; align-items: stretch; }.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 12px/1.5 var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; }.btn { border: 1px solid var(--line); background: var(--raised); border-radius: 8px; padding: 7px 12px; cursor: pointer; text-decoration: none; text-align: center; font-weight: 500; white-space: nowrap; }.btn:hover { border-color: var(--faint); }.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }.btn-row .btn { flex: 1 1 auto; }.more { border-radius: var(--radius); padding: 12px; background: var(--accent-soft); font-size: 13px; display: grid; gap: 8px; }.more p { margin: 0; }/* Phone and narrow tablet: one column, filters and details as overlays */@media (max-width: 900px) {.layout, .layout.has-detail { grid-template-columns: minmax(0, 1fr); }.filters-toggle { display: inline-block; }.top-links a:not(.cta) { display: none; }.side { position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); z-index: 20; transform: translateX(-100%); transition: transform 0.2s; box-shadow: 0 0 40px rgba(0,0,0,0.4); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }.side.open { transform: none; }.detail { position: fixed; inset: 0; z-index: 30; }.detail-scroll { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }.grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }}@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236# /// script# requires-python = ">=3.10"# dependencies = ["usd-core"]# ///"""Build data/catalog.json for the projectsim SimReady Library Space.
Sources:- the public Hugging Face dataset projectsim/simready-assets: one SimReady package per top-level folder. Per asset we read com.nvidia.simready.packaging.json (package id and version), .metadata/<asset>_benchmark.json (NVIDIA benchmark results) and the root layer of simready_usd/<asset>.usd (SimReady_Metadata, semantic class, joints);- NVIDIA-Omniverse/simready-central via the `gh` CLI: the submission file on main lists merged packages, the same file on each open projectsim PR branch lists packages in review.
Root USD files are 1-35 MB, so their metadata is cached in tools/meta_cache.json, keyedby package id. A rebuild only downloads packages that are new or have a new version.
Run from the Space folder: uv run tools/build_catalog.pyThen upload: hf upload projectsim/simready-library . --repo-type space"""
import argparseimport jsonimport osimport reimport subprocessimport sysimport tempfileimport urllib.requestfrom concurrent.futures import ThreadPoolExecutorfrom datetime import datetime, timezone
from pxr import Sdf
HF = "https://huggingface.co"CENTRAL = "NVIDIA-Omniverse/simready-central"SHORT_ENGINE = {"isaac_sim": "physx", "isaac_sim_newton": "newton"}
def get_json(url): with urllib.request.urlopen(url, timeout=120) as r: return json.load(r)
def list_files(dataset): """Every file in the dataset at main, plus the main commit sha.""" sha = get_json(f"{HF}/api/datasets/{dataset}")["sha"] url, files = f"{HF}/api/datasets/{dataset}/tree/{sha}?recursive=true&limit=1000", [] while url: with urllib.request.urlopen(url, timeout=120) as r: files += [x for x in json.load(r) if x["type"] == "file"] m = re.search(r'<([^>]+)>;\s*rel="next"', r.headers.get("Link") or "") url = m.group(1) if m else None return sha, files
def read_root_layer(path): """SimReady metadata, semantic class and joints from the asset's root layer.""" layer = Sdf.Layer.FindOrOpen(path) meta = dict(layer.customLayerData.get("SimReady_Metadata", {})) prim = layer.GetPrimAtPath("/" + layer.defaultPrim)
def label(attr): spec = prim.attributes.get(attr) if prim else None value = list(spec.default or []) if spec else [] return value[0] if value else None
joints, mounted = [], False
def visit(p): nonlocal mounted spec = layer.GetObjectAtPath(p) if not isinstance(spec, Sdf.PrimSpec) or not spec.typeName.startswith("Physics") or "Joint" not in spec.typeName: return bodies = [list(spec.relationships[r].targetPathList.GetAddedOrExplicitItems()) if r in spec.relationships else [] for r in ("physics:body0", "physics:body1")] if spec.typeName == "PhysicsFixedJoint": mounted = mounted or not bodies[0] or not bodies[1] return kind = {"PhysicsRevoluteJoint": "hinge", "PhysicsPrismaticJoint": "slider"}.get(spec.typeName, "joint") lim = [spec.attributes[a].default if a in spec.attributes else None for a in ("physics:lowerLimit", "physics:upperLimit")] joints.append({"name": spec.name, "type": kind, "lower": lim[0], "upper": lim[1]})
layer.Traverse(Sdf.Path.absoluteRootPath, visit) extents = [float(x) for x in re.findall(r"[-\d.eE+]+", str(meta.get("asset_extents", "")))][:3] return { "category": meta.get("category"), "qcode": meta.get("qcode") or label("semantics:labels:wikidata_qcode"), "class": label("semantics:labels:class"), "mass": meta.get("mass"), "rigid_bodies": meta.get("rigid_body_count"), "extents": extents or None, "license": meta.get("asset_license"), "date": meta.get("usd_date_generated"), "joints": sorted(joints, key=lambda j: j["name"]), "mounted": mounted, }
def fetch_asset(dataset, sha, asset, root_path): base = f"{HF}/datasets/{dataset}/resolve/{sha}/{asset}" with tempfile.TemporaryDirectory() as tmp: local = os.path.join(tmp, f"{asset}.usd") urllib.request.urlretrieve(f"{base}/{root_path}", local) return read_root_layer(local)
def benchmark(dataset, sha, asset): try: b = get_json(f"{HF}/datasets/{dataset}/resolve/{sha}/{asset}/.metadata/{asset}_benchmark.json") except Exception: return None tests = [[r["test_name"], SHORT_ENGINE.get(r["engine"], r["engine"]), r["status"]] for r in b.get("results", [])] return {"passed": b.get("passed"), "run": b.get("run_timestamp"), "tests": tests}
def nvidia_status(dataset): """asset -> {status, pr}; empty if gh is unavailable.""" path = f"submissions/{dataset}"
def listed(ref): out = subprocess.run(["gh", "api", f"repos/{CENTRAL}/contents/{path}?ref={ref}", "-H", "Accept: application/vnd.github.raw"], capture_output=True, text=True) return set(re.findall(rf"/resolve/[0-9a-f]+/([^/]+)/com\.nvidia\.simready\.packaging\.json", out.stdout)) \ if out.returncode == 0 else set()
try: status = {a: {"status": "merged"} for a in listed("main")} prs = json.loads(subprocess.run( ["gh", "pr", "list", "--repo", CENTRAL, "--state", "open", "--search", f"{dataset} in:title", "--json", "number,headRefName"], capture_output=True, text=True, check=True).stdout) except (OSError, subprocess.CalledProcessError) as e: print(f"warning: NVIDIA status skipped ({e})", file=sys.stderr) return {} for pr in prs: for a in listed(pr["headRefName"]): status.setdefault(a, {"status": "in_review", "pr": pr["number"]}) return status
def main(): ap = argparse.ArgumentParser() ap.add_argument("--dataset", default="projectsim/simready-assets") ap.add_argument("--out", default="data/catalog.json") ap.add_argument("--cache", default="tools/meta_cache.json") ap.add_argument("--groups", default="tools/groups.json") ap.add_argument("--workers", type=int, default=8) args = ap.parse_args()
groups = json.load(open(args.groups)) cache = json.load(open(args.cache)) if os.path.exists(args.cache) else {} sha, files = list_files(args.dataset) by_asset = {} for f in files: if "/" in f["path"]: by_asset.setdefault(f["path"].split("/")[0], []).append(f["path"])
assets, todo = {}, [] for asset, paths in sorted(by_asset.items()): root = f"simready_usd/{asset}.usd" if f"{asset}/{root}" not in paths or f"{asset}/com.nvidia.simready.packaging.json" not in paths: print(f"skip {asset}: not a SimReady package", file=sys.stderr) continue assets[asset] = {"root": root, "paths": paths}
def package_id(asset): return get_json(f"{HF}/datasets/{args.dataset}/resolve/{sha}/{asset}/com.nvidia.simready.packaging.json")["package_id"]
with ThreadPoolExecutor(args.workers) as pool: ids = dict(zip(assets, pool.map(package_id, assets))) todo = [a for a in assets if ids[a] not in cache] print(f"{len(assets)} packages, {len(todo)} new or changed", file=sys.stderr)
def load(a): meta = fetch_asset(args.dataset, sha, a, assets[a]["root"]) meta["benchmark"] = benchmark(args.dataset, sha, a) return a, meta
for i, (a, meta) in enumerate(pool.map(load, todo), 1): cache[ids[a]] = meta if i % 25 == 0 or i == len(todo): print(f" read {i}/{len(todo)}", file=sys.stderr) json.dump(cache, open(args.cache, "w"), indent=0, sort_keys=True)
status = nvidia_status(args.dataset) unmapped, records = set(), [] for a in sorted(assets): m = cache[ids[a]] raw = (m["category"] or "").strip().lower() category = groups.get("aliases", {}).get(raw, raw) group = groups["categories"].get(category) if group is None: unmapped.add(m["category"]) group = "Other" paths = assets[a]["paths"] records.append({ "id": a, "name": a.replace("_", " ").capitalize(), "group": group, "category": category, "class": m["class"], "qcode": m["qcode"], "mass": m["mass"], "extents": m["extents"], "rigid_bodies": m["rigid_bodies"], "joints": m["joints"], "mounted": m["mounted"], "license": m["license"], "date": m["date"], "version": ids[a].split(f".{a}.", 1)[-1], "benchmark": m["benchmark"], "nvidia": status.get(a, {"status": "not_submitted"}), "glass": any("/simready_usd/materials/" in p for p in paths), })
out = { "dataset": args.dataset, "commit": sha, "built": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), "groups": groups["order"], "assets": records, } os.makedirs(os.path.dirname(args.out), exist_ok=True) json.dump(out, open(args.out, "w"), separators=(",", ":")) json.dump(cache, open(args.cache, "w"), indent=0, sort_keys=True) counts = {} for r in records: counts[r["nvidia"]["status"]] = counts.get(r["nvidia"]["status"], 0) + 1 print(f"wrote {args.out}: {len(records)} assets, NVIDIA {counts}", file=sys.stderr) if unmapped: print(f"warning: add these categories to {args.groups}: {sorted(unmapped)}", file=sys.stderr)
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131{ "_comment": "How assets are grouped in the Library. Each asset's SimReady category (SimReady_Metadata.category in its USD) is lowercased, renamed through 'aliases' when listed there, then placed in a group through 'categories'. build_catalog.py warns about categories it can't place; they show under 'Other' until added here.", "order": [ "Kitchen & food", "Home & household", "Furniture & storage", "Tools & hardware", "Health & personal care", "Office & electronics", "Packaging & logistics", "Toys, hobbies & sports", "Other" ], "categories": { "food container": "Kitchen & food", "food packaging": "Kitchen & food", "fruit": "Kitchen & food", "vegetable": "Kitchen & food", "kitchen utensil": "Kitchen & food", "kitchen appliance": "Kitchen & food", "tableware": "Kitchen & food", "household chemical container": "Home & household", "household": "Home & household", "household appliance": "Home & household", "waste bin": "Home & household", "home decor": "Home & household", "lighting": "Home & household", "sewing and crafts": "Home & household", "furniture": "Furniture & storage", "storage and cases": "Furniture & storage", "tool storage": "Furniture & storage", "hand tool": "Tools & hardware", "garden tool": "Tools & hardware", "hardware": "Tools & hardware", "plumbing fixture": "Tools & hardware", "industrial equipment": "Tools & hardware", "personal protective equipment": "Tools & hardware", "personal care container": "Health & personal care", "personal care": "Health & personal care", "medical and mobility aid": "Health & personal care", "optical instrument": "Health & personal care", "office and stationery": "Office & electronics", "electronics": "Office & electronics", "packaging": "Packaging & logistics", "material handling": "Packaging & logistics", "toy": "Toys, hobbies & sports", "sports and recreation": "Toys, hobbies & sports", "musical instrument": "Toys, hobbies & sports" }, "aliases": { "accessibility equipment": "medical and mobility aid", "appliance": "household appliance", "appliances": "household appliance", "audio equipment": "electronics", "bags and cases": "storage and cases", "bathing aids": "medical and mobility aid", "bathroom accessories": "household", "beauty and personal care": "personal care", "bed safety accessories": "medical and mobility aid", "cleaning tools": "household", "consumer electronics": "electronics", "container closures": "packaging", "dental care accessories": "personal care", "drinkware": "tableware", "embroidery equipment": "sewing and crafts", "exercise equipment": "sports and recreation", "fireplace accessories": "home decor", "fishing equipment": "sports and recreation", "games and recreation": "toy", "games and toys": "toy", "gardening tools": "garden tool", "hair care appliances": "personal care", "hand tools": "hand tool", "health and personal care": "personal care", "home fragrance accessories": "home decor", "household / laundry accessories": "household", "household appliances": "household appliance", "household cleaning tools": "household", "household equipment": "household", "household hardware": "hardware", "household items": "household", "household tools": "household", "household waste containers": "waste bin", "infant furniture": "furniture", "keys and locks": "hardware", "kitchen appliances": "kitchen appliance", "kitchen equipment": "kitchen appliance", "kitchen storage": "food container", "kitchen tools": "kitchen utensil", "kitchen utensils": "kitchen utensil", "kitchenware": "kitchen utensil", "locks and security hardware": "hardware", "luggage": "storage and cases", "material handling equipment": "material handling", "mechanical toys": "toy", "media storage": "storage and cases", "medical equipment": "medical and mobility aid", "mobility aids": "medical and mobility aid", "musical equipment": "musical instrument", "musical instrument accessories": "musical instrument", "office equipment": "office and stationery", "office supplies": "office and stationery", "optical instruments": "optical instrument", "packaging tools": "packaging", "personal accessories": "personal care", "personal care / eye care": "personal care", "personal care / manicure tools": "personal care", "personal care appliances": "personal care", "personal care tools": "personal care", "pest control": "household", "physics demonstration apparatus": "toy", "rocks and minerals": "personal care", "sewing accessories": "sewing and crafts", "sewing tools": "sewing and crafts", "shoe care accessories": "household", "shopping and carrying equipment": "material handling", "sporting equipment storage": "storage and cases", "stationery": "office and stationery", "storage container": "storage and cases", "storage containers": "storage and cases", "tile cutting tools": "hand tool", "tools": "hand tool", "tools and equipment": "hand tool", "tools and machinery": "hand tool", "toys": "toy", "toys and games": "toy", "vehicles": "sports and recreation", "waste container": "waste bin", "weapons": "toy" }}README.md+56-5
app.jsAdded+390
data/catalog.jsonAdded
index.html+73-17
style.css+178-22
tools/build_catalog.pyAdded+236
tools/groups.jsonAdded+131
tools/meta_cache.jsonAdded