henry000 commited on
Commit
0e6029d
Β·
2 Parent(s): ea07ae6 a56a51f

πŸ”€ [Merge] branch 'TEST' into DOCKER

Browse files
tests/test_tools/test_data_loader.py CHANGED
@@ -66,4 +66,4 @@ def test_directory_stream_data_loader_frame(directory_stream_data_loader: Stream
66
  frame, rev_tensor, origin_frame = next(iter(directory_stream_data_loader))
67
  assert frame.shape == (1, 3, 640, 640)
68
  assert rev_tensor.shape == (1, 5)
69
- assert origin_frame.size == (480, 640)
 
66
  frame, rev_tensor, origin_frame = next(iter(directory_stream_data_loader))
67
  assert frame.shape == (1, 3, 640, 640)
68
  assert rev_tensor.shape == (1, 5)
69
+ assert origin_frame.size == (480, 640) or origin_frame.size == (512, 640)
tests/test_tools/test_dataset_preparation.py CHANGED
@@ -22,7 +22,8 @@ def test_prepare_dataset(train_cfg: Config):
22
  assert len(os.listdir(data_type)) == 5
23
 
24
  annotations_path = Path("tests/data/annotations")
25
- assert os.listdir(annotations_path) == ["instances_val.json", "instances_train.json"]
 
26
 
27
 
28
  def test_prepare_weight():
 
22
  assert len(os.listdir(data_type)) == 5
23
 
24
  annotations_path = Path("tests/data/annotations")
25
+ assert "instances_val.json" in os.listdir(annotations_path)
26
+ assert "instances_train.json" in os.listdir(annotations_path)
27
 
28
 
29
  def test_prepare_weight():
yolo/utils/model_utils.py CHANGED
@@ -94,7 +94,8 @@ def get_device(device_spec: Union[str, int, List[int]]) -> torch.device:
94
  device_spec = initialize_distributed()
95
  if torch.cuda.is_available() and "cuda" in str(device_spec):
96
  return torch.device(device_spec), ddp_flag
97
- return torch.device("cpu"), False
 
98
 
99
 
100
  class PostProccess:
 
94
  device_spec = initialize_distributed()
95
  if torch.cuda.is_available() and "cuda" in str(device_spec):
96
  return torch.device(device_spec), ddp_flag
97
+ device = torch.device(device_spec)
98
+ return device, ddp_flag
99
 
100
 
101
  class PostProccess: