henry000 commited on
Commit
07fa01d
·
1 Parent(s): d1477fc

✅ [Pass] git action with install cv2 lib

Browse files
.github/workflows/main.yaml CHANGED
@@ -19,6 +19,8 @@ jobs:
19
 
20
  - name: Install dependencies
21
  run: |
 
 
22
  python -m pip install --upgrade pip
23
  pip install -r requirements.txt
24
 
 
19
 
20
  - name: Install dependencies
21
  run: |
22
+ sudo apt-get update
23
+ sudo apt-get install -y libgl1-mesa-glx
24
  python -m pip install --upgrade pip
25
  pip install -r requirements.txt
26
 
tests/test_model/test_module.py CHANGED
@@ -2,10 +2,10 @@ import sys
2
  from pathlib import Path
3
 
4
  import torch
5
- from torch import nn
6
 
7
  project_root = Path(__file__).resolve().parent.parent.parent
8
  sys.path.append(str(project_root))
 
9
  from yolo.model.module import SPPELAN, ADown, CBLinear, Conv, Pool
10
 
11
  STRIDE = 2
 
2
  from pathlib import Path
3
 
4
  import torch
 
5
 
6
  project_root = Path(__file__).resolve().parent.parent.parent
7
  sys.path.append(str(project_root))
8
+
9
  from yolo.model.module import SPPELAN, ADown, CBLinear, Conv, Pool
10
 
11
  STRIDE = 2
tests/test_model/test_yolo.py CHANGED
@@ -37,7 +37,7 @@ def cfg() -> Config:
37
  @pytest.fixture
38
  def model(cfg: Config):
39
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
40
- model = create_model(cfg.model)
41
  return model.to(device)
42
 
43
 
 
37
  @pytest.fixture
38
  def model(cfg: Config):
39
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
40
+ model = create_model(cfg.model, weight_path=None)
41
  return model.to(device)
42
 
43
 
tests/test_utils/test_dataaugment.py CHANGED
@@ -1,7 +1,6 @@
1
  import sys
2
  from pathlib import Path
3
 
4
- import pytest
5
  import torch
6
  from PIL import Image
7
  from torchvision.transforms import functional as TF
 
1
  import sys
2
  from pathlib import Path
3
 
 
4
  import torch
5
  from PIL import Image
6
  from torchvision.transforms import functional as TF
yolo/tools/__init__.py ADDED
File without changes
yolo/tools/data_loader.py CHANGED
@@ -5,7 +5,6 @@ from threading import Event, Thread
5
  from typing import Generator, List, Tuple, Union
6
 
7
  import cv2
8
- import hydra
9
  import numpy as np
10
  import torch
11
  from loguru import logger
@@ -257,11 +256,6 @@ class StreamDataLoader:
257
  self.process_frame(frame)
258
  cap.release()
259
 
260
- def cv2_to_tensor(self, frame: np.ndarray) -> Tensor:
261
- frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
262
- frame_float = frame_rgb.astype("float32") / 255.0
263
- return torch.from_numpy(frame_float).permute(2, 0, 1)[None]
264
-
265
  def process_frame(self, frame):
266
  if isinstance(frame, np.ndarray):
267
  frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
 
5
  from typing import Generator, List, Tuple, Union
6
 
7
  import cv2
 
8
  import numpy as np
9
  import torch
10
  from loguru import logger
 
256
  self.process_frame(frame)
257
  cap.release()
258
 
 
 
 
 
 
259
  def process_frame(self, frame):
260
  if isinstance(frame, np.ndarray):
261
  frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)