diff --git a/helloworld.py b/helloworld.py index fc33b92..f0b818f 100644 --- a/helloworld.py +++ b/helloworld.py @@ -1,21 +1,6 @@ import cv2 +import torch - -def detect_cameras(max_cameras=10): - cameras = [] - for i in range(max_cameras): - cap = cv2.VideoCapture(i) - if cap is None or not cap.isOpened(): - cap.release() - else: - cameras.append(i) - cap.release() - return cameras - - -# available_cameras = detect_cameras() -# print(f'Found {len(available_cameras)} camera(s): {available_cameras}' - -image = cv2.imread("nst/ori/1.jpg") -cv2.imshow("Image", image) -cv2.waitKey(0) \ No newline at end of file +print(torch.__version__) +use_cuda = torch.cuda.is_available() # 是否有可用的gpu +print(use_cuda) diff --git a/main_windows/main_window.py b/main_windows/main_window.py index af10cb5..fff6693 100644 --- a/main_windows/main_window.py +++ b/main_windows/main_window.py @@ -82,7 +82,7 @@ class MainWindow(QMainWindow): def pushButton_8(self): self.sub_window_8_ = sub_window_8.SubWindow() self.sub_window_8_.show() - + def pushButton_10(self): self.sub_window_10_ = sub_window_10.SubWindow() self.sub_window_10_.show() diff --git a/nst/1.jpg b/nst/1.jpg new file mode 100644 index 0000000..577b685 Binary files /dev/null and b/nst/1.jpg differ diff --git a/nst/Models.py b/nst/Models.py index 1329423..6b2eab8 100644 --- a/nst/Models.py +++ b/nst/Models.py @@ -296,7 +296,7 @@ if __name__ == "__main__": # model = models.vgg19(pretrained=True) ph = "weights/vgg19-dcbb9e9d.pth" - transfer = Transfer("./ori/2.jpg", "./art/2.jpg", ph) + transfer = Transfer("ori/2.jpg", "art/2.jpg", ph) t = time.time() dt, img = transfer.fit()