mxlin043 commited on
Commit
50d6f48
·
verified ·
1 Parent(s): b17c80f

EmbRACE Viewer: read task_ folders

Browse files
Files changed (2) hide show
  1. index.html +6 -5
  2. style.css +0 -28
index.html CHANGED
@@ -12,9 +12,9 @@
12
  and as a static Space in front of the Hugging Face dataset repo.
13
 
14
  index/web/tasks.json every task, loaded once
15
- <split>/trajectory/<Env>/<Task>/infos.json the record of a task, loaded when it is opened
16
- <split>/trajectory/<Env>/<Task>/NNN.jpg its frames (split: dataset or benchmark)
17
- benchmark/success_region/<Env>/<Task>/... the two region images of a benchmark task
18
 
19
  The data location comes from ?data=<url>, else from the embrace-data meta tag above.
20
  ?split=dataset|benchmark &env=<Env> &type=0-5 &q=<text> &task=<Env>/<Task> &step=<n>
@@ -233,8 +233,9 @@ header { display:flex; align-items:center; gap:14px; padding:0 20px; border-bott
233
  filtered: [], task: null, record: null, step: 0 };
234
  const records = new Map();
235
 
236
- const trajUrl = (t, file) => `${DATA}${t.split}/trajectory/${t.env.id}/${t.stem}/${file}`;
237
- const areaUrl = (t, file) => `${DATA}${t.split}/success_region/${t.env.id}/${t.stem}/${file}`;
 
238
 
239
  async function loadIndex() {
240
  const url = DATA + "index/web/tasks.json";
 
12
  and as a static Space in front of the Hugging Face dataset repo.
13
 
14
  index/web/tasks.json every task, loaded once
15
+ <split>/trajectory/<Env>/task_<Task>/infos.json the record of a task, loaded when it is opened
16
+ <split>/trajectory/<Env>/task_<Task>/NNN.jpg its frames (split: dataset or benchmark)
17
+ benchmark/success_region/<Env>/task_<Task>/... the two region images of a benchmark task
18
 
19
  The data location comes from ?data=<url>, else from the embrace-data meta tag above.
20
  ?split=dataset|benchmark &env=<Env> &type=0-5 &q=<text> &task=<Env>/<Task> &step=<n>
 
233
  filtered: [], task: null, record: null, step: 0 };
234
  const records = new Map();
235
 
236
+ // On the Hub every task folder carries the prefix task_ (the Hub refuses paths with "/x00").
237
+ const trajUrl = (t, file) => `${DATA}${t.split}/trajectory/${t.env.id}/task_${t.stem}/${file}`;
238
+ const areaUrl = (t, file) => `${DATA}${t.split}/success_region/${t.env.id}/task_${t.stem}/${file}`;
239
 
240
  async function loadIndex() {
241
  const url = DATA + "index/web/tasks.json";
style.css DELETED
@@ -1,28 +0,0 @@
1
- body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
- }
5
-
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
- }
10
-
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
- }
17
-
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
- }
25
-
26
- .card p:last-child {
27
- margin-bottom: 0;
28
- }