gera-richarte commited on
Commit
805f17c
1 Parent(s): 7f0f541

fix(earthview.py): compatibility with latest EarthView, with updated metadata

Browse files
Files changed (2) hide show
  1. earthview.py +6 -2
  2. utils.py +5 -2
earthview.py CHANGED
@@ -12,7 +12,7 @@ DATASET = "satellogic/EarthView"
12
 
13
  sets = {
14
  "satellogic": {
15
- "shards" : 3676,
16
  },
17
  "sentinel_1": {
18
  "shards" : 1763,
@@ -43,7 +43,11 @@ def load_dataset(subset, dataset="satellogic/EarthView", split="train", shards =
43
  if shards is None:
44
  data_files = None
45
  else:
46
- data_files = [f"{path}/{split}-{shard:05d}-of-{nshards:05d}.parquet" for shard in shards]
 
 
 
 
47
  data_files = {split: data_files}
48
 
49
  ds = _load_dataset(
 
12
 
13
  sets = {
14
  "satellogic": {
15
+ "shards" : 7863,
16
  },
17
  "sentinel_1": {
18
  "shards" : 1763,
 
43
  if shards is None:
44
  data_files = None
45
  else:
46
+ if subset == "satellogic":
47
+ shards = {1000*shard//nshards for shard in shards}
48
+ data_files = [f"{path}/satellogic_v2-{shard}/{split}-*.parquet" for shard in shards]
49
+ else:
50
+ data_files = [f"{path}/{split}-{shard:05d}-of-{nshards:05d}.parquet" for shard in shards]
51
  data_files = {split: data_files}
52
 
53
  ds = _load_dataset(
utils.py CHANGED
@@ -15,8 +15,7 @@ def lat_lon_mid_pixel(item, subset: str):
15
  metadata = get_metadata(item)
16
  if subset == "satellogic":
17
  crs = metadata["crs"][0]
18
- # each image has bounds but they should coincide
19
- bounds_crs = metadata["bounds"][0]
20
  elif subset == "sentinel_1":
21
  crs = metadata["crs"]
22
  bounds_crs = metadata["coordinates"][0]
@@ -28,6 +27,10 @@ def lat_lon_mid_pixel(item, subset: str):
28
  bounds_crs[2][0],
29
  bounds_crs[2][1],
30
  )
 
 
 
 
31
  else:
32
  raise ValueError("subset not known")
33
 
 
15
  metadata = get_metadata(item)
16
  if subset == "satellogic":
17
  crs = metadata["crs"][0]
18
+ bounds_crs = metadata["bounds"]
 
19
  elif subset == "sentinel_1":
20
  crs = metadata["crs"]
21
  bounds_crs = metadata["coordinates"][0]
 
27
  bounds_crs[2][0],
28
  bounds_crs[2][1],
29
  )
30
+ # elif subset == "neon":
31
+ # crs = metadata["epsg"]
32
+ # bounds_crs = metadata["bounds"]
33
+
34
  else:
35
  raise ValueError("subset not known")
36