gera-richarte commited on
Commit
4779900
1 Parent(s): 3326301

changed to new API for token (not use_auth_token)

Browse files
app.py CHANGED
@@ -48,7 +48,7 @@ def open_dataset(dataset, set_name, split, batch_size, shard = -1):
48
  cache_dir="dataset",
49
  data_files=data_files,
50
  streaming=True,
51
- use_auth_token=os.environ.get("HF_TOKEN"))
52
 
53
  dsi = iter(ds)
54
 
@@ -74,8 +74,11 @@ def get_images(batch_size):
74
  break
75
  metadata = item["metadata"]
76
  if ds.config_name == "satellogic":
 
 
77
  image = np.asarray(item["rgb"][0]).astype(np.uint8)
78
  items.append(image.transpose(1,2,0))
 
79
  if ds.config_name == "sentinel_1":
80
  metadata = json.loads(metadata)
81
  data = np.asarray(item["10m"])
@@ -87,6 +90,7 @@ def get_images(batch_size):
87
  image[1] = data[i][1]
88
  image[2] = (image[0]/(image[1]+0.1))*256
89
  items.append(image.transpose(1,2,0))
 
90
  if ds.config_name == "default":
91
  dataRGB = np.asarray(item["rgb"]).astype("uint8")
92
  dataCHM = np.asarray(item["chm"]).astype("uint8")
 
48
  cache_dir="dataset",
49
  data_files=data_files,
50
  streaming=True,
51
+ token=os.environ.get("HF_TOKEN", None))
52
 
53
  dsi = iter(ds)
54
 
 
74
  break
75
  metadata = item["metadata"]
76
  if ds.config_name == "satellogic":
77
+ # image = (np.asarray(item["1m"])).astype("uint8")
78
+ # items.append(image[0,0,:,:])
79
  image = np.asarray(item["rgb"][0]).astype(np.uint8)
80
  items.append(image.transpose(1,2,0))
81
+
82
  if ds.config_name == "sentinel_1":
83
  metadata = json.loads(metadata)
84
  data = np.asarray(item["10m"])
 
90
  image[1] = data[i][1]
91
  image[2] = (image[0]/(image[1]+0.1))*256
92
  items.append(image.transpose(1,2,0))
93
+
94
  if ds.config_name == "default":
95
  dataRGB = np.asarray(item["rgb"]).astype("uint8")
96
  dataCHM = np.asarray(item["chm"]).astype("uint8")
dataset/dataset_satellogic___earth_view_satellogic-503b90dad9c40a74_0.0.0_ef77b19bb1dd2600f407022c67e8a153a5633358.lock ADDED
File without changes
dataset/dataset_satellogic___earth_view_satellogic-6f8ae4f8d920496c_0.0.0_ef77b19bb1dd2600f407022c67e8a153a5633358.lock ADDED
File without changes