sps44 commited on
Commit
7eefcaa
1 Parent(s): 1d6c0ac
Files changed (5) hide show
  1. README.md +3 -4
  2. prepare.py +1 -1
  3. run.py +5 -2
  4. sliceline-layout.json +1 -0
  5. sliceline.pkl +3 -0
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Explore CIFAR-100 Enriched with Spotlight
3
  emoji: 📊
4
  colorFrom: gray
5
  colorTo: blue
@@ -13,9 +13,8 @@ datasets:
13
  tags:
14
  - renumics
15
  - spotlight
16
- - EDA
17
- - enriched
18
- duplicated_from: renumics/cifar100-enriched
19
  ---
20
 
21
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: Explore data slices in the CIFAR-100 benchmark
3
  emoji: 📊
4
  colorFrom: gray
5
  colorTo: blue
 
13
  tags:
14
  - renumics
15
  - spotlight
16
+ - sliceline
17
+ - data-centric-ai
 
18
  ---
19
 
20
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
prepare.py CHANGED
@@ -11,7 +11,7 @@ if __name__ == "__main__":
11
  print("Dataset loaded from cache.")
12
  else:
13
  # Load dataset using datasets.load_dataset()
14
- dataset = datasets.load_dataset("renumics/cifar100-enriched", split="train")
15
  print("Dataset loaded using datasets.load_dataset().")
16
 
17
  # Save dataset to cache
 
11
  print("Dataset loaded from cache.")
12
  else:
13
  # Load dataset using datasets.load_dataset()
14
+ dataset = datasets.load_dataset("renumics/cifar100-enriched", split="test")
15
  print("Dataset loaded using datasets.load_dataset().")
16
 
17
  # Save dataset to cache
run.py CHANGED
@@ -5,6 +5,7 @@ import os
5
 
6
  if __name__ == "__main__":
7
  cache_file = "dataset_cache.pkl"
 
8
  if os.path.exists(cache_file):
9
  # Load dataset from cache
10
  with open(cache_file, "rb") as file:
@@ -20,11 +21,13 @@ if __name__ == "__main__":
20
  pickle.dump(dataset, file)
21
 
22
  print("Dataset saved to cache.")
23
-
 
 
24
 
25
  df = dataset.to_pandas()
26
  df_show = df.drop(columns=['embedding', 'probabilities'])
27
  while True:
28
- view = spotlight.show(df_show.sample(5000, random_state=1), port=7860, host="0.0.0.0",
29
  dtype={"image": spotlight.Image, "embedding_reduced": spotlight.Embedding}, allow_filebrowsing=False)
30
  view.close()
 
5
 
6
  if __name__ == "__main__":
7
  cache_file = "dataset_cache.pkl"
8
+ issue_cache_file="sliceline.pkl"
9
  if os.path.exists(cache_file):
10
  # Load dataset from cache
11
  with open(cache_file, "rb") as file:
 
21
  pickle.dump(dataset, file)
22
 
23
  print("Dataset saved to cache.")
24
+
25
+ with open(issue_cache_file, "rb") as issue_file:
26
+ issues = pickle.load(issue_file)
27
 
28
  df = dataset.to_pandas()
29
  df_show = df.drop(columns=['embedding', 'probabilities'])
30
  while True:
31
+ view = spotlight.show(df_show, port=7860, host="0.0.0.0", issues=issues,
32
  dtype={"image": spotlight.Image, "embedding_reduced": spotlight.Embedding}, allow_filebrowsing=False)
33
  view.close()
sliceline-layout.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"orientation":"vertical","children":[{"kind":"split","weight":1,"orientation":"horizontal","children":[{"kind":"tab","weight":1,"children":[{"kind":"widget","name":"Table","type":"table","config":{"tableView":"selected","visibleColumns":null,"sorting":null,"orderByRelevance":false}}]},{"kind":"tab","weight":1,"children":[{"kind":"widget","name":"Similarity Map","type":"similaritymap","config":{"placeBy":null,"reductionMethod":null,"colorBy":"fine_label_prediction_error","sizeBy":null,"filter":false,"umapNNeighbors":20,"umapMetric":null,"umapMinDist":0.15,"pcaNormalization":null,"umapMenuLocalGlobalBalance":null,"umapMenuIsAdvanced":false}}]},{"kind":"tab","weight":1,"children":[{"kind":"widget","name":"Issues","type":"IssuesWidget","config":null}]}]},{"kind":"tab","weight":1,"children":[{"kind":"widget","name":"Inspector","type":"inspector","config":{"views":[{"view":"ArrayLens","key":"12MuLXBrGWyR1UqByhSAGR","name":"embedding_reduced","columns":["embedding_reduced"]},{"view":"ImageView","key":"tuCdyeyADoxB7jtazsiLt2","name":"image","columns":["image"]},{"view":"TextLens","columns":["fine_label_prediction_str"],"name":"view","key":"45099023-3dcc-4f56-baa3-b0447a98a3c6"},{"view":"TextLens","columns":["fine_label_str"],"name":"view","key":"f057b3df-7920-4adb-bf6f-03c260a56b94"}]}}]}]}
sliceline.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af9bff1ba785b9effd303824617bb3c79ee1113d1bf7786d2c878541340d2eb1
3
+ size 8504