Skip to content

Webcam window resizing #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Action Detection Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,27 @@
"sentence = []\n",
"threshold = 0.8\n",
"\n",
"# Set the webcam window to custom size to fit more words, in this case (1280, 720)\n",
"cap = cv2.VideoCapture(0)\n",
"def make_1080p():\n",
" cap.set(3, 1920)\n",
" cap.set(4, 1080)\n",
"\n",
"def make_720p():\n",
" cap.set(3, 1280)\n",
" cap.set(4, 720)\n",
"\n",
"def make_480p():\n",
" cap.set(3, 640)\n",
" cap.set(4, 480)\n",
"\n",
"def change_res(width, height):\n",
" cap.set(3, width)\n",
" cap.set(4, height)\n",
"\n",
"make_720p()\n",
"change_res(1280, 720)\n",
"\n",
"# Set mediapipe model \n",
"with mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=0.5) as holistic:\n",
" while cap.isOpened():\n",
Expand Down