Gabriel commited on
Commit
95803a5
1 Parent(s): 276b02e

test new req

Browse files
Files changed (2) hide show
  1. helper/examples/examples.py +7 -4
  2. requirements.txt +4 -3
helper/examples/examples.py CHANGED
@@ -14,8 +14,8 @@ class DemoImages:
14
 
15
  def __init__(self, url="Riksarkivet/test_images_demo", cache_dir="./helper/examples/.cache_images"):
16
  if not hasattr(self, "images_datasets"):
17
- self.images_datasets = datasets.load_dataset(url, cache_dir=cache_dir)
18
- self.example_df = self.images_datasets["train"].to_pandas()
19
  self.examples_list = self.convert_bytes_to_images()
20
 
21
  def convert_bytes_to_images(self):
@@ -41,6 +41,9 @@ class DemoImages:
41
 
42
 
43
  if __name__ == "__main__":
44
- test = DemoImages(cache_dir=".cache_images")
45
 
46
- print(test.examples_list)
 
 
 
 
14
 
15
  def __init__(self, url="Riksarkivet/test_images_demo", cache_dir="./helper/examples/.cache_images"):
16
  if not hasattr(self, "images_datasets"):
17
+ self.images_datasets = datasets.load_dataset(url, cache_dir=cache_dir, split="train")
18
+ self.example_df = self.images_datasets.to_pandas()
19
  self.examples_list = self.convert_bytes_to_images()
20
 
21
  def convert_bytes_to_images(self):
 
41
 
42
 
43
  if __name__ == "__main__":
44
+ # test = DemoImages(cache_dir=".cache_images")
45
 
46
+ # print(test.examples_list)
47
+
48
+ images_datasets = datasets.load_dataset("Riksarkivet/test_images_demo", cache_dir="./helper/examples/.cache_images")
49
+ print(images_datasets["train"]["image"][0])
requirements.txt CHANGED
@@ -1,14 +1,14 @@
1
  torch==2.0.1
2
  torchvision==0.15.2
3
  openmim==0.3.9
4
- gradio==3.41.1
5
  pandas==2.0.3
6
  numpy==1.25.0
7
  opencv-python-headless==4.7.0.72
8
  Jinja2==3.1.2
9
  transformers==4.30.2
10
  huggingface-hub==0.15.1
11
- datasets==2.13.1
12
  requests==2.31.0
13
  pillow==9.5.0
14
 
@@ -19,4 +19,5 @@ pillow==9.5.0
19
  # !mim install mmengine
20
  # !mim install mmcv
21
  # !mim install mmdet
22
- # !mim install mmocr
 
 
1
  torch==2.0.1
2
  torchvision==0.15.2
3
  openmim==0.3.9
4
+ gradio==3.41.0
5
  pandas==2.0.3
6
  numpy==1.25.0
7
  opencv-python-headless==4.7.0.72
8
  Jinja2==3.1.2
9
  transformers==4.30.2
10
  huggingface-hub==0.15.1
11
+ datasets==2.14.5
12
  requests==2.31.0
13
  pillow==9.5.0
14
 
 
19
  # !mim install mmengine
20
  # !mim install mmcv
21
  # !mim install mmdet
22
+ # !mim install mmocr
23
+