-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
42 lines (27 loc) · 843 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Hello, from Flask!"
# import cv2
# # Open the default camera (usually the built-in webcam)
# cap = cv2.VideoCapture(0)
# # Check if the camera is opened successfully
# if not cap.isOpened():
# print("Error: Could not open webcam.")
# exit()
# while True:
# # Read a frame from the webcam
# success, img = cap.read()
# # Check if the frame is read successfully
# if not success:
# print("Error: Failed to read frame from webcam.")
# break
# # Display the frame
# cv2.imshow("Webcam", img)
# # Exit the loop if 'q' key is pressed
# if cv2.waitKey(1) & 0xFF == ord('q'):
# break
# # Release the webcam and close all OpenCV windows
# cap.release()
# cv2.destroyAllWindows()