Skip to content

Commit 468eb7b

Browse files
authored
Merge pull request #4 from hdnh2006/master
gpu support for autolabeling is now possible for yolov5
2 parents 57d8456 + 9cd9478 commit 468eb7b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

anylabeling/services/auto_labeling/yolov5.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def __init__(self, model_config, on_message) -> None:
3939
raise Exception(f"Model not found: {model_abs_path}")
4040

4141
self.net = cv2.dnn.readNet(model_abs_path)
42+
self.net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
43+
self.net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)
4244
self.classes = self.config["classes"]
4345

4446
def pre_process(self, input_image, net):

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ PyYAML==6.0
1818
colorama==0.4.5
1919
onnx==1.13.1
2020
onnxruntime==1.14.1
21-
qimage2ndarray==1.10.0
21+
qimage2ndarray==1.10.0

0 commit comments

Comments
 (0)