sps44 commited on
Commit
ffa84f1
1 Parent(s): 92e6506

first version emodb dataset

Browse files
Dockerfile CHANGED
@@ -2,16 +2,16 @@ FROM python:3.9
2
 
3
  WORKDIR /code
4
  ENV HOME=/code
5
- COPY ./renumics_spotlight-1.3.0.post9+b32d1a8-py3-none-any.whl /code/renumics_spotlight-1.3.0.post9+b32d1a8-py3-none-any.whl
6
  # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
7
 
8
  RUN apt install curl
9
  RUN pip install pip -U
10
 
11
- RUN pip install renumics_spotlight-1.3.0.post9+b32d1a8-py3-none-any.whl
12
 
13
 
14
- RUN pip install pyarrow datasets cleanvision
15
 
16
  COPY . .
17
  RUN mkdir -p /code/.cache
 
2
 
3
  WORKDIR /code
4
  ENV HOME=/code
5
+ COPY ./renumics_spotlight-1.3.0.post104+adfcaf1-py3-none-any /code/renumics_spotlight-1.3.0.post104+adfcaf1-py3-none-any
6
  # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
7
 
8
  RUN apt install curl
9
  RUN pip install pip -U
10
 
11
+ RUN pip install renumics_spotlight-1.3.0.post104+adfcaf1-py3-none-any
12
 
13
 
14
+ RUN pip install pyarrow datasets
15
 
16
  COPY . .
17
  RUN mkdir -p /code/.cache
sliceguard-issues.pkl → emodb_embedding_issues.pickle RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fe2c652c7600f011f0225e9e6fc9c133781409f7d1a1b4ce3a1c5871809cda25
3
- size 22835
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f4a5b1d01f9e233e28b90b00cf5c797cc28b469ea8ee266c76db02ed436c44f
3
+ size 1607
emodb_full_results.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18945df7fe2fd9a963ddc60295486bd77482a9202b66b3ae6ef7dec9e7d029a5
3
+ size 11134181
cifar100-enrichment-cv.parquet → emodb_metadata_issues.pickle RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0bc7e67b598b765cce75309f7c414a13ca9fcc8004f436a0490822c899bfa66c
3
- size 544628
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ae74f1f53f539a5ea1418210e8126bf6849b3b2a5366b170f9558893fca9953
3
+ size 3695
layout-model-comparison.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"orientation":"horizontal","children":[{"kind":"split","weight":22.443871668302805,"orientation":"vertical","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Table","type":"table","config":{"tableView":"selected","visibleColumns":null,"sorting":null,"orderByRelevance":false}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Similarity Map","type":"similaritymap","config":{"placeBy":null,"reductionMethod":null,"colorBy":"m1_gender_prediction_error","sizeBy":null,"filter":false,"umapNNeighbors":20,"umapMetric":null,"umapMinDist":0.15,"pcaNormalization":null,"umapMenuLocalGlobalBalance":null,"umapMenuIsAdvanced":false}}]}]},{"kind":"split","weight":19.08256196026494,"orientation":"vertical","children":[{"kind":"split","weight":4.406531194985268,"orientation":"horizontal","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Accuracy Filtered vs. Selected","type":"Metric","config":{"config":{"metric":"accuracy","columns":{"X":"m1_gender_prediction_error"}}}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"F1-Score Filtered vs. Selected","type":"Metric","config":{"config":{"metric":"F1","columns":{"X":"gender_bool","Y":"m1_gender_pred_bool"}}}}]}]},{"kind":"tab","weight":12.861339016257817,"children":[{"kind":"widget","name":"Confusion Matrix","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"m1_gender_prediction"}}]},{"kind":"tab","weight":12.861339016257817,"children":[{"kind":"widget","name":"Issues (from Sliceguard)","type":"IssuesWidget"}]}]},{"kind":"split","weight":17.45935648231709,"orientation":"vertical","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Gender vs. Emotion","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"emotion"}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Gender vs. Age","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"age"}}]}]},{"kind":"tab","weight":16.908583738243667,"children":[{"kind":"widget","name":"Inspector","type":"inspector","config":{"views":[{"view":"SpectrogramView","columns":["audio"],"name":"view","key":"07aaaf22-1586-453a-b9cb-674ea68f1079"},{"view":"AudioView","key":"5dKVmNM6c2fijG2GAPAKhD","name":"audio","columns":["audio"]},{"view":"ScalarView","columns":["gender"],"name":"view","key":"ac749b5f-98c5-47da-9026-df3134fd9ffb"},{"view":"TextLens","columns":["m1_gender_prediction_string"],"name":"view","key":"2c85598a-750e-4186-94aa-d311dd7aec37"}],"visibleColumns":4}}]}]}
layout-model-debug.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"orientation":"horizontal","children":[{"kind":"split","weight":25.053244418990598,"orientation":"vertical","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Table","type":"table","config":{"tableView":"selected","visibleColumns":null,"sorting":null,"orderByRelevance":false}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Similarity Map","type":"similaritymap","config":{"placeBy":null,"reductionMethod":null,"colorBy":null,"sizeBy":null,"filter":false,"umapNNeighbors":20,"umapMetric":null,"umapMinDist":0.15,"pcaNormalization":null,"umapMenuLocalGlobalBalance":null,"umapMenuIsAdvanced":false}}]}]},{"kind":"split","weight":17.30115185099882,"orientation":"vertical","children":[{"kind":"tab","weight":4.406531194985268,"children":[{"kind":"widget","name":"Metric","type":"Metric","config":{"config":{"metric":"F1","columns":{"X":"m1_gender_prediction_error"}}}}]},{"kind":"tab","weight":25.722678032515635,"children":[{"kind":"widget","name":"Confusion Matrix","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"m1_gender_prediction"}}]}]},{"kind":"split","weight":16.905244485987403,"orientation":"vertical","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Confusion Matrix (3)","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"emotion"}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Confusion Matrix (2)","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"age"}}]}]},{"kind":"tab","weight":16.634733093151677,"children":[{"kind":"widget","name":"Inspector","type":"inspector","config":{"views":null,"visibleColumns":4}}]}]}
prepare.py CHANGED
@@ -11,10 +11,10 @@ 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="test")
15
  print("Dataset loaded using datasets.load_dataset().")
16
 
17
- df = dataset.to_pandas()
18
 
19
  # Save dataset to cache
20
  df.to_parquet(cache_file)
 
11
  print("Dataset loaded from cache.")
12
  else:
13
  # Load dataset using datasets.load_dataset()
14
+ dataset = datasets.load_dataset("renumics/emodb", split="test")
15
  print("Dataset loaded using datasets.load_dataset().")
16
 
17
+ df = dataset.to_pandas()
18
 
19
  # Save dataset to cache
20
  df.to_parquet(cache_file)
renumics_spotlight-1.3.0.post9+b32d1a8-py3-none-any.whl → renumics_spotlight-1.3.0.post104+adfcaf1-py3-none-any.whl RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:39f23ad15279cfeebb210ccd9ca29dc30075d5f9b61934cb23b55d07207317a5
3
- size 2494250
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da1729500bbe890af38f8fd7161b1a693a4aac10800f6341fdbbcfed49df3178
3
+ size 2525322
run.py CHANGED
@@ -6,28 +6,28 @@ import pandas as pd
6
 
7
  if __name__ == "__main__":
8
  cache_file = "dataset_cache.parquet"
9
- cache_file_enrichment="cifar100-enrichment-cv.parquet"
10
- cache_file_issues="sliceguard-issues.pkl"
11
 
12
  if os.path.exists(cache_file):
13
  # Load dataset from cache
14
- df = pd.read_parquet(cache_file)
15
  print("Dataset loaded from cache.")
16
  else:
17
  # Load dataset using datasets.load_dataset()
18
- dataset = datasets.load_dataset("renumics/cifar100-enriched", split="test")
19
  print("Dataset loaded using datasets.load_dataset().")
20
 
21
- df = dataset.to_pandas()
22
 
23
  # Save dataset to cache
24
- df.to_parquet(cache_file)
25
 
26
  print("Dataset saved to cache.")
27
 
28
- df_cv=pd.read_parquet(cache_file_enrichment)
29
 
30
- df = pd.concat([df, df_cv], axis=1)
31
 
32
  with open(cache_file_issues, "rb") as issue_file:
33
  issues = pickle.load(issue_file)
@@ -35,6 +35,10 @@ if __name__ == "__main__":
35
  #df = dataset.to_pandas()
36
  df_show = df.drop(columns=['embedding', 'probabilities'])
37
  while True:
38
- view = spotlight.show(df_show, issues=issues, port=7860, host="0.0.0.0", layout="sliceguard-layout.json",
39
- dtype={"image": spotlight.Image, "embedding_reduced": spotlight.Embedding}, allow_filebrowsing=False)
 
 
 
 
40
  view.close()
 
6
 
7
  if __name__ == "__main__":
8
  cache_file = "dataset_cache.parquet"
9
+ cache_file_enrichment="emodb_full_results.parquet"
10
+ cache_file_issues="emodb_metadata_issues.pkl"
11
 
12
  if os.path.exists(cache_file):
13
  # Load dataset from cache
14
+ df_db = pd.read_parquet(cache_file)
15
  print("Dataset loaded from cache.")
16
  else:
17
  # Load dataset using datasets.load_dataset()
18
+ dataset = datasets.load_dataset("renumics/emodb", split="test")
19
  print("Dataset loaded using datasets.load_dataset().")
20
 
21
+ df_db = dataset.to_pandas()
22
 
23
  # Save dataset to cache
24
+ df_db.to_parquet(cache_file)
25
 
26
  print("Dataset saved to cache.")
27
 
28
+ df=pd.read_parquet(cache_file_enrichment)
29
 
30
+ df['audio'] = df_db['audio']
31
 
32
  with open(cache_file_issues, "rb") as issue_file:
33
  issues = pickle.load(issue_file)
 
35
  #df = dataset.to_pandas()
36
  df_show = df.drop(columns=['embedding', 'probabilities'])
37
  while True:
38
+ dtypes = dtype={"audio": spotlight.Audio,
39
+ 'm1_embedding':spotlight.Embedding,
40
+ 'm2_embedding':spotlight.Embedding,
41
+ 'embedding_emotion':spotlight.Embedding}
42
+ view = spotlight.show(df_show, issues=issues, port=7860, host="0.0.0.0", layout="layout-model-debug.json",
43
+ dtype=dtypes}, allow_filebrowsing=False)
44
  view.close()
sliceguard-layout.json DELETED
@@ -1 +0,0 @@
1
- {"orientation":"vertical","children":[{"kind":"split","weight":55.98243688254665,"orientation":"horizontal","children":[{"kind":"tab","weight":30.029340660631746,"children":[{"kind":"widget","name":"Table","type":"table","config":{"tableView":"full","visibleColumns":null,"sorting":null,"orderByRelevance":false}}]},{"kind":"tab","weight":27.735432693500154,"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":42.235226645868096,"children":[{"kind":"widget","name":"Issues","type":"IssuesWidget","config":null},{"kind":"widget","name":"Scatter Plot","type":"scatterplot","config":{"xAxisColumn":null,"yAxisColumn":null,"colorBy":null,"sizeBy":null,"filter":false}},{"kind":"widget","name":"Histogram","type":"histogram","config":{"columnKey":"dark_score","stackByColumnKey":"fine_label_prediction_error","filter":false}}]}]},{"kind":"tab","weight":44.01756311745335,"children":[{"kind":"widget","name":"Inspector","type":"inspector","config":{"views":[{"view":"ImageView","columns":["full_image"],"name":"full_image","key":"8GcjVfK27yKRQzznAqWMRG"},{"view":"TextLens","columns":["fine_label_prediction_str"],"name":"view","key":"797cd1ce-e56a-42de-87ac-f82d09a4f519"},{"view":"TextLens","columns":["fine_label_str"],"name":"view","key":"37df2c98-2676-4479-9984-8b30516fcf40"}],"visibleColumns":4}}]}]}