MarkusStoll commited on
Commit
bb4dab5
1 Parent(s): 02765ca

layout, spotlight fix, cache fix

Browse files
Files changed (3) hide show
  1. Dockerfile +4 -2
  2. run.py +3 -2
  3. spotlight-layout.json +1 -0
Dockerfile CHANGED
@@ -6,11 +6,13 @@ ENV HOME=/code
6
  # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
7
 
8
  RUN apt install curl
9
- RUN curl -LJO https://spotlightpublic.blob.core.windows.net/github-public/Renumics/renumics_spotlight-1.1.0.post32+03ea5c8-py3-none-any.whl
10
- RUN pip install renumics_spotlight-1.1.0.post32+03ea5c8-py3-none-any.whl
 
11
  RUN pip install datasets
12
 
13
  COPY . .
14
  RUN mkdir -p /code/.cache
15
  RUN chmod -R 777 /code
 
16
  CMD ["python", "run.py"]
 
6
  # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
7
 
8
  RUN apt install curl
9
+ RUN curl -LJO https://spotlightpublic.blob.core.windows.net/github-public/Renumics/renumics_spotlight-1.1.0.post34+853e8be-py3-none-any
10
+ RUN pip install renumics_spotlight-1.1.0.post34+853e8be-py3-none-any
11
+
12
  RUN pip install datasets
13
 
14
  COPY . .
15
  RUN mkdir -p /code/.cache
16
  RUN chmod -R 777 /code
17
+ RUN python prepare.py
18
  CMD ["python", "run.py"]
run.py CHANGED
@@ -18,10 +18,11 @@ if __name__ == "__main__":
18
  # Save dataset to cache
19
  with open(cache_file, "wb") as file:
20
  pickle.dump(dataset, file)
21
- print("Dataset saved to cache.")
 
22
 
23
 
24
  df = dataset.to_pandas()
25
  df_show = df.drop(columns=['embedding', 'probabilities'])
26
  spotlight.show(df_show.sample(5000, random_state=1), port=7860, host="0.0.0.0",
27
- dtype={"image": spotlight.Image, "embedding_reduced": spotlight.Embedding}, allow_filebrowsing=False)
 
18
  # Save dataset to cache
19
  with open(cache_file, "wb") as file:
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
  spotlight.show(df_show.sample(5000, random_state=1), port=7860, host="0.0.0.0",
28
+ dtype={"image": spotlight.Image, "embedding_reduced": spotlight.Embedding}, allow_filebrowsing=False, layout="spotlight-layout.json")
spotlight-layout.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"orientation":"vertical","children":[{"kind":"split","weight":55.52608311229001,"orientation":"horizontal","children":[{"kind":"tab","weight":41.16700201207244,"children":[{"kind":"widget","name":"Table","type":"table","config":{"tableView":"full","visibleColumns":["coarse_label_str","fine_label_prediction_str","fine_label_str","image","__idx__"],"sorting":[["__idx__","DESC"]],"orderByRelevance":false,"columnWidths":{"coarse_label":92,"coarse_label_str":165,"embedding_reduced":128,"fine_label":92,"fine_label_prediction":92,"fine_label_prediction_error":92,"fine_label_prediction_str":244,"fine_label_str":194,"full_image":256,"image":200,"split":256,"__idx__":92,"__last_edited_at__":192,"__last_edited_by__":256}}}]},{"kind":"tab","weight":33.66487769877306,"children":[{"kind":"widget","name":"Similarity Map","type":"similaritymap","config":{"placeBy":null,"reductionMethod":null,"colorBy":"fine_label_str","sizeBy":null,"filter":false,"umapNNeighbors":20,"umapMetric":null,"umapMinDist":0.15,"pcaNormalization":null,"umapMenuLocalGlobalBalance":null,"umapMenuIsAdvanced":false}},{"kind":"widget","name":"Scatter Plot","type":"scatterplot","config":{"xAxisColumn":null,"yAxisColumn":null,"colorBy":null,"sizeBy":null,"filter":false}}]},{"kind":"tab","weight":25.168120289154498,"children":[{"kind":"widget","name":"Histogram","type":"histogram","config":{"columnKey":"fine_label_str","stackByColumnKey":"fine_label_prediction_error","filter":false}}]}]},{"kind":"tab","weight":44.47391688770999,"children":[{"kind":"widget","name":"Inspector","type":"inspector","config":{"views":[{"view":"ImageView","key":"es3NP2fbYeG5TzTQqCzZKL","name":"image","columns":["image"]},{"view":"TextLens","columns":["fine_label_str"],"name":"view","key":"7262001a-1270-467c-bfe8-6b6883adbc7d"},{"view":"TextLens","columns":["fine_label_prediction_str"],"name":"view","key":"f72a8ae9-17c4-4097-b454-79a6f60865db"},{"view":"ScalarView","columns":["fine_label_prediction_error"],"name":"view","key":"be4d6afe-9093-4581-b363-df11d3c6d34a"}],"visibleColumns":4}}]}]}