henry000 commited on
Commit
a984cc6
Β·
2 Parent(s): dbe7505 6db27bb

πŸ”€ [Merge] branch 'DOCKER' of github.com:WongKinYiu/yolov9mit into DOCKER

Browse files
.github/workflows/docker.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Docker Image Deploy to DockerHub
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout repository
15
+ uses: actions/checkout@v3
16
+
17
+ - name: Set up Docker Buildx
18
+ uses: docker/setup-buildx-action@v3
19
+
20
+ - name: Log in to Docker Hub
21
+ uses: docker/login-action@v2
22
+ with:
23
+ username: henrytsui000
24
+ password: ${{ secrets.DOCKER_PASSWORD }}
25
+
26
+ - name: Extract metadata (tags, labels) for Docker
27
+ id: meta
28
+ uses: docker/metadata-action@v4
29
+ with:
30
+ images: henrytsui000/yolo
31
+
32
+ - name: Build and push Docker image
33
+ uses: docker/build-push-action@v4
34
+ with:
35
+ context: .
36
+ file: docker/Dockerfile
37
+ push: true
38
+ tags: ${{ steps.meta.outputs.tags }}
39
+ labels: ${{ steps.meta.outputs.labels }}
40
+
41
+ - name: Image digest
42
+ run: echo ${{ steps.meta.outputs.digest }}
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,7 @@ 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
- if not torch.cuda.is_available() and not torch.backends.mps.is_available():
98
  if device_spec != "cpu":
99
  logger.warning(f"❎ Device spec: {device_spec} not support, Choosing CPU instead")
100
  return torch.device("cpu"), False
 
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
+ if not torch.cuda.is_available():
98
  if device_spec != "cpu":
99
  logger.warning(f"❎ Device spec: {device_spec} not support, Choosing CPU instead")
100
  return torch.device("cpu"), False