sps44 commited on
Commit
4b062f5
โ€ข
1 Parent(s): ccd92be

new spotlight version

Browse files
Dockerfile CHANGED
@@ -2,14 +2,19 @@ FROM python:3.9
2
 
3
  WORKDIR /code
4
  ENV HOME=/code
5
- COPY ./renumics_spotlight-1.3.0.post116+a49d537-py3-none-any.whl /code/renumics_spotlight-1.3.0.post116+a49d537-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
  RUN pip install pydantic==1.10.8
11
 
12
- RUN pip install renumics_spotlight-1.3.0.post116+a49d537-py3-none-any.whl
 
 
 
13
 
14
 
15
  RUN pip install pyarrow datasets
 
2
 
3
  WORKDIR /code
4
  ENV HOME=/code
5
+
6
+ COPY ./renumics_spotlight-1.4.0.post18+cd16f7b-py3-none-any.whl /code/renumics_spotlight-1.4.0.post18+cd16f7b-py3-none-any.whl
7
+
8
  # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
 
10
  RUN apt install curl
11
  RUN pip install pip -U
12
  RUN pip install pydantic==1.10.8
13
 
14
+
15
+ RUN pip install renumics_spotlight-1.4.0.post18+cd16f7b-py3-none-any.whl
16
+
17
+
18
 
19
 
20
  RUN pip install pyarrow datasets
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Compare two different voice analytics models
3
  emoji: ๐ŸŽ™๏ธ
4
  colorFrom: red
5
  colorTo: blue
 
1
  ---
2
+ title: Debug a voice analytics model
3
  emoji: ๐ŸŽ™๏ธ
4
  colorFrom: red
5
  colorTo: blue
emodb_embedding_issues.pkl โ†’ embedding_issues.pkl RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5f4a5b1d01f9e233e28b90b00cf5c797cc28b469ea8ee266c76db02ed436c44f
3
- size 1607
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f14d05f9c09ce14e208c72c463ee745de34be9ba6c59f0af9e7ccf0295baf7f0
3
+ size 1647
emodb_full_results.parquet DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0a0abe6f42c0bc929838e1f56ac956b34b7d75ff4c45e01d3a53a5459d8fa7fa
3
- size 11141947
 
 
 
 
layout-model-comparison.json DELETED
@@ -1 +0,0 @@
1
- {"orientation":"horizontal","children":[{"kind":"split","weight":19.132176677590795,"orientation":"vertical","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Table","type":"table","config":{"tableView":"full","visibleColumns":null,"sorting":null,"orderByRelevance":false}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Embedding on emotion model","type":"similaritymap","config":{"placeBy":null,"reductionMethod":null,"colorBy":"m2_gender_prediction_error","sizeBy":null,"filter":false,"umapNNeighbors":20,"umapMetric":null,"umapMinDist":0.15,"pcaNormalization":null,"umapMenuLocalGlobalBalance":null,"umapMenuIsAdvanced":false}}]}]},{"kind":"split","weight":14.89969874351945,"orientation":"vertical","children":[{"kind":"split","weight":6.546302818342063,"orientation":"horizontal","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Accuracy","type":"Metric","config":{"metric":"accuracy","columns":["gender_bool","m1_gender_pred_bool"]}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"F1","type":"Metric","config":{"metric":"F1","columns":["gender_bool","m1_gender_pred_bool"]}}]}]},{"kind":"tab","weight":25.584633033153384,"children":[{"kind":"widget","name":"Confusion Matrix","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"m1_gender_prediction_string"}}]},{"kind":"tab","weight":25.584633033153384,"children":[{"kind":"widget","name":"Confusion Matrix (2)","type":"ConfusionMatrix","config":{"xColumn":"gender_bool","yColumn":"m2_gender_pred_bool"}}]}]},{"kind":"split","weight":15.312004107540265,"orientation":"vertical","children":[{"kind":"tab","weight":54.21436004162331,"children":[{"kind":"widget","name":"Model 1 vs Model 2 prediction errors","type":"ConfusionMatrix","config":{"xColumn":"m1_gender_prediction_error","yColumn":"m2_gender_prediction_error"}}]},{"kind":"tab","weight":45.78563995837669,"children":[{"kind":"widget","name":"Issues from Sliceguard","type":"IssuesWidget","config":null}]}]},{"kind":"tab","weight":16.634733093151677,"children":[{"kind":"widget","name":"Inspector","type":"inspector","config":{"views":[{"view":"AudioView","columns":["audio"],"name":"audio","key":"tY8GHhvKXUvWMumcC6aEK4"},{"view":"ScalarView","columns":["gender"],"name":"view","key":"464686a8-db0d-40a5-a31d-38323f66e99a"},{"view":"TextLens","columns":["m1_gender_prediction_string"],"name":"view","key":"9ced1617-7d59-4abf-acb0-c9a8ed393ebf"},{"view":"SpectrogramView","columns":["audio"],"name":"view","key":"95aead50-93b4-4a80-a9b2-38a5ba1521f6"}],"visibleColumns":4}}]}]}
 
 
layout-model-debug.json DELETED
@@ -1 +0,0 @@
1
- {"orientation":"horizontal","children":[{"kind":"split","weight":22.1951801110117,"orientation":"vertical","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Table","type":"table","config":{"tableView":"full","visibleColumns":null,"sorting":null,"orderByRelevance":false}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Embedding on emotion model","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":15.587276091496047,"orientation":"vertical","children":[{"kind":"split","weight":11.751097808946518,"orientation":"horizontal","children":[{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"Accuracy","type":"Metric","config":{"metric":"accuracy","columns":["gender_bool","m1_gender_prediction_error"]}}]},{"kind":"tab","weight":50,"children":[{"kind":"widget","name":"F1","type":"Metric","config":{"metric":"F1","columns":["gender_bool","m1_gender_prediction_error"]}}]}]},{"kind":"tab","weight":45.964471075702306,"children":[{"kind":"widget","name":"Confusion Matrix","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"m1_gender_prediction_string"}}]},{"kind":"tab","weight":42.28443111535119,"children":[{"kind":"widget","name":"Issues from Sliceguard","type":"IssuesWidget","config":null}]}]},{"kind":"split","weight":11.561423326142764,"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":"Confusion Matrix (2)","type":"ConfusionMatrix","config":{"xColumn":"gender","yColumn":"age"}}]}]},{"kind":"tab","weight":16.634733093151677,"children":[{"kind":"widget","name":"Inspector","type":"inspector","config":{"views":[{"view":"AudioView","columns":["audio"],"name":"audio","key":"tY8GHhvKXUvWMumcC6aEK4"},{"view":"ScalarView","columns":["gender"],"name":"view","key":"464686a8-db0d-40a5-a31d-38323f66e99a"},{"view":"TextLens","columns":["m1_gender_prediction_string"],"name":"view","key":"9ced1617-7d59-4abf-acb0-c9a8ed393ebf"},{"view":"SpectrogramView","columns":["audio"],"name":"view","key":"95aead50-93b4-4a80-a9b2-38a5ba1521f6"}],"visibleColumns":4}}]}]}
 
 
emodb_metadata_issues.pkl โ†’ metadata_issues.pkl RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6ae74f1f53f539a5ea1418210e8126bf6849b3b2a5366b170f9558893fca9953
3
- size 3695
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a984f1de18e34614d5e5383a5c0476723588171d8f01fcfcdd2cdfbe62b7a3d1
3
+ size 3869
prepare.py CHANGED
@@ -3,21 +3,21 @@ import datasets
3
  import os
4
  import pandas as pd
5
 
 
 
6
  if __name__ == "__main__":
7
- cache_file = "dataset_cache.parquet"
8
- if os.path.exists(cache_file):
 
 
 
9
  # Load dataset from cache
10
- df = pd.read_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="all")
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)
21
-
22
- print("Dataset saved to cache.")
23
 
 
3
  import os
4
  import pandas as pd
5
 
6
+ from datasets import load_dataset_builder
7
+
8
  if __name__ == "__main__":
9
+
10
+ #builder = load_dataset_builder('renumics/emodb-enriched')
11
+ print('no preparation here')
12
+
13
+ #if os.path.exists(builder._cache_dir):
14
  # Load dataset from cache
15
+ # ds = datasets.load_dataset('renumics/emodb-enriched', split='all')
16
+ # print("Dataset loaded from cache.")
17
+ #else:
18
  # Load dataset using datasets.load_dataset()
19
+ # ds = datasets.load_dataset('renumics/emodb-enriched', split='all')
20
+ # print("Dataset loaded using datasets.load_dataset().")
21
 
22
+
 
 
 
 
 
23
 
renumics_spotlight-1.3.0.post116+a49d537-py3-none-any.whl โ†’ renumics_spotlight-1.4.0.post18+cd16f7b-py3-none-any.whl RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1229d32fdd502c860bf93232e8f526c1132ba7cde7ee796338e0dea004977d00
3
- size 2525800
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3ec724a28fdd2e88bcad9de202781629bef33ee9498703583161b5a513ad4eb
3
+ size 2936788
run.py CHANGED
@@ -3,41 +3,26 @@ import datasets
3
  from renumics import spotlight
4
  import os
5
  import pandas as pd
 
 
 
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="all")
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)
34
 
35
 
36
  while True:
37
- dtypes = dtype={"audio": spotlight.Audio,
38
- 'm1_embedding':spotlight.Embedding,
39
- 'm2_embedding':spotlight.Embedding,
40
- 'embedding_emotion':spotlight.Embedding}
41
- view = spotlight.show(df, issues=issues, port=7860, host="0.0.0.0", layout="layout-model-comparison.json",
42
- dtype=dtypes, allow_filebrowsing=False)
43
  view.close()
 
3
  from renumics import spotlight
4
  import os
5
  import pandas as pd
6
+ from renumics.spotlight.layouts import compare_classification
7
+
8
+
9
 
10
  if __name__ == "__main__":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
+ cache_file_issues="embedding_issues.pkl"
13
+
14
+ # Load dataset using datasets.load_dataset()
15
+ ds = datasets.load_dataset("renumics/emodb-enriched", split="all")
16
+ print("Dataset loaded using datasets.load_dataset().")
17
 
 
 
 
 
 
18
 
19
  with open(cache_file_issues, "rb") as issue_file:
20
  issues = pickle.load(issue_file)
21
 
22
 
23
  while True:
24
+ layout = compare_classification(label='gender', model1_prediction='m1_gender_prediction', model1_embedding='m1_embedding', model1_correct='m1_correct', model2_prediction='m2_gender_prediction', model2_embedding='m2_embedding', model2_correct='m2_correct', inspect={'audio': spotlight.Audio})
25
+
26
+ view = spotlight.show(ds, issues=issues, port=7860, host="0.0.0.0", layout=layout,
27
+ allow_filebrowsing=False)
 
 
28
  view.close()