jmercat commited on
Commit
2f360f3
1 Parent(s): 481fd2b

update numpy.bool8 to numpy.bool_

Browse files
export_waymo_to_json.py CHANGED
@@ -70,12 +70,12 @@ if __name__ == "__main__":
70
  decoded = json.load(f)
71
 
72
  x_c = torch.from_numpy(numpy.array(decoded["x"]).astype(numpy.float32))
73
- mask_x_c = torch.from_numpy(numpy.array(decoded["mask_x"]).astype(numpy.bool8))
74
  y_c = torch.from_numpy(numpy.array(decoded["y"]).astype(numpy.float32))
75
- mask_y_c = torch.from_numpy(numpy.array(decoded["mask_y"]).astype(numpy.bool8))
76
- mask_loss_c = torch.from_numpy( numpy.array(decoded["mask_loss"]).astype(numpy.bool8))
77
  map_data_c = torch.from_numpy(numpy.array(decoded["map_data"]).astype(numpy.float32))
78
- mask_map_c = torch.from_numpy(numpy.array(decoded["mask_map"]).astype(numpy.bool8))
79
  offset_c = torch.from_numpy(numpy.array(decoded["offset"]).astype(numpy.float32))
80
  x_ego_c = torch.from_numpy(numpy.array(decoded["x_ego"]).astype(numpy.float32))
81
  y_ego_c = torch.from_numpy(numpy.array(decoded["y_ego"]).astype(numpy.float32))
 
70
  decoded = json.load(f)
71
 
72
  x_c = torch.from_numpy(numpy.array(decoded["x"]).astype(numpy.float32))
73
+ mask_x_c = torch.from_numpy(numpy.array(decoded["mask_x"]).astype(numpy.bool_))
74
  y_c = torch.from_numpy(numpy.array(decoded["y"]).astype(numpy.float32))
75
+ mask_y_c = torch.from_numpy(numpy.array(decoded["mask_y"]).astype(numpy.bool_))
76
+ mask_loss_c = torch.from_numpy( numpy.array(decoded["mask_loss"]).astype(numpy.bool_))
77
  map_data_c = torch.from_numpy(numpy.array(decoded["map_data"]).astype(numpy.float32))
78
+ mask_map_c = torch.from_numpy(numpy.array(decoded["mask_map"]).astype(numpy.bool_))
79
  offset_c = torch.from_numpy(numpy.array(decoded["offset"]).astype(numpy.float32))
80
  x_ego_c = torch.from_numpy(numpy.array(decoded["x_ego"]).astype(numpy.float32))
81
  y_ego_c = torch.from_numpy(numpy.array(decoded["y_ego"]).astype(numpy.float32))
import_dataset_from_huggingface.py CHANGED
@@ -30,12 +30,12 @@ sample_dataloader = dataloaders.sample_dataloader()
30
  dataset = load_dataset("jmercat/risk_biased_dataset", split="test")
31
 
32
  x_c = torch.from_numpy(numpy.array(dataset["x"]).astype(numpy.float32))
33
- mask_x_c = torch.from_numpy(numpy.array(dataset["mask_x"]).astype(numpy.bool8))
34
  y_c = torch.from_numpy(numpy.array(dataset["y"]).astype(numpy.float32))
35
- mask_y_c = torch.from_numpy(numpy.array(dataset["mask_y"]).astype(numpy.bool8))
36
- mask_loss_c = torch.from_numpy( numpy.array(dataset["mask_loss"]).astype(numpy.bool8))
37
  map_data_c = torch.from_numpy(numpy.array(dataset["map_data"]).astype(numpy.float32))
38
- mask_map_c = torch.from_numpy(numpy.array(dataset["mask_map"]).astype(numpy.bool8))
39
  offset_c = torch.from_numpy(numpy.array(dataset["offset"]).astype(numpy.float32))
40
  x_ego_c = torch.from_numpy(numpy.array(dataset["x_ego"]).astype(numpy.float32))
41
  y_ego_c = torch.from_numpy(numpy.array(dataset["y_ego"]).astype(numpy.float32))
 
30
  dataset = load_dataset("jmercat/risk_biased_dataset", split="test")
31
 
32
  x_c = torch.from_numpy(numpy.array(dataset["x"]).astype(numpy.float32))
33
+ mask_x_c = torch.from_numpy(numpy.array(dataset["mask_x"]).astype(numpy.bool_))
34
  y_c = torch.from_numpy(numpy.array(dataset["y"]).astype(numpy.float32))
35
+ mask_y_c = torch.from_numpy(numpy.array(dataset["mask_y"]).astype(numpy.bool_))
36
+ mask_loss_c = torch.from_numpy( numpy.array(dataset["mask_loss"]).astype(numpy.bool_))
37
  map_data_c = torch.from_numpy(numpy.array(dataset["map_data"]).astype(numpy.float32))
38
+ mask_map_c = torch.from_numpy(numpy.array(dataset["mask_map"]).astype(numpy.bool_))
39
  offset_c = torch.from_numpy(numpy.array(dataset["offset"]).astype(numpy.float32))
40
  x_ego_c = torch.from_numpy(numpy.array(dataset["x_ego"]).astype(numpy.float32))
41
  y_ego_c = torch.from_numpy(numpy.array(dataset["y_ego"]).astype(numpy.float32))
scripts/scripts_utils/plotly_interface.py CHANGED
@@ -56,12 +56,12 @@ def configuration_paths() -> Iterable[os.PathLike]:
56
 
57
  def load_item(index: int, dataset: Dataset, device: str = "cpu") -> Tuple:
58
  x = torch.from_numpy(numpy.array(dataset[index]["x"]).astype(numpy.float32)).to(device)
59
- mask_x = torch.from_numpy(numpy.array(dataset[index]["mask_x"]).astype(numpy.bool8)).to(device)
60
  y = torch.from_numpy(numpy.array(dataset[index]["y"]).astype(numpy.float32)).to(device)
61
- mask_y = torch.from_numpy(numpy.array(dataset[index]["mask_y"]).astype(numpy.bool8)).to(device)
62
- mask_loss = torch.from_numpy( numpy.array(dataset[index]["mask_loss"]).astype(numpy.bool8)).to(device)
63
  map_data = torch.from_numpy(numpy.array(dataset[index]["map_data"]).astype(numpy.float32)).to(device)
64
- mask_map = torch.from_numpy(numpy.array(dataset[index]["mask_map"]).astype(numpy.bool8)).to(device)
65
  offset = torch.from_numpy(numpy.array(dataset[index]["offset"]).astype(numpy.float32)).to(device)
66
  x_ego = torch.from_numpy(numpy.array(dataset[index]["x_ego"]).astype(numpy.float32)).to(device)
67
  y_ego = torch.from_numpy(numpy.array(dataset[index]["y_ego"]).astype(numpy.float32)).to(device)
 
56
 
57
  def load_item(index: int, dataset: Dataset, device: str = "cpu") -> Tuple:
58
  x = torch.from_numpy(numpy.array(dataset[index]["x"]).astype(numpy.float32)).to(device)
59
+ mask_x = torch.from_numpy(numpy.array(dataset[index]["mask_x"]).astype(numpy.bool_)).to(device)
60
  y = torch.from_numpy(numpy.array(dataset[index]["y"]).astype(numpy.float32)).to(device)
61
+ mask_y = torch.from_numpy(numpy.array(dataset[index]["mask_y"]).astype(numpy.bool_)).to(device)
62
+ mask_loss = torch.from_numpy( numpy.array(dataset[index]["mask_loss"]).astype(numpy.bool_)).to(device)
63
  map_data = torch.from_numpy(numpy.array(dataset[index]["map_data"]).astype(numpy.float32)).to(device)
64
+ mask_map = torch.from_numpy(numpy.array(dataset[index]["mask_map"]).astype(numpy.bool_)).to(device)
65
  offset = torch.from_numpy(numpy.array(dataset[index]["offset"]).astype(numpy.float32)).to(device)
66
  x_ego = torch.from_numpy(numpy.array(dataset[index]["x_ego"]).astype(numpy.float32)).to(device)
67
  y_ego = torch.from_numpy(numpy.array(dataset[index]["y_ego"]).astype(numpy.float32)).to(device)