Unable to generate exe file

151 views
Skip to first unread message

Vaishnav Chunduru

unread,
Apr 30, 2021, 2:50:22 AM4/30/21
to PyInstaller
I am Vaishnav Chunduru, A senior year mechanical engineering student from Amrita School of Engineering, Bangalore 
I am working on an application to control a vertical globe used hand gestures which are recognized by the pc webcam

Can anyone tell me the process to make an exe file for the following.py file? 
I am unable to generate a working exe file for the following python code (It has mediapipe libraries linked to it)

import cv2
import mediapipe
import os
# For webcam input:
hands = mediapipe.solutions.hands.Hands(min_detection_confidence=0.5, min_tracking_confidence=0.5)
cap = cv2.VideoCapture(0)
while cap.isOpened():
  success, image = cap.read()
  if not success:
    print("Ignoring empty camera frame.")
    # If loading a video, use 'break' instead of 'continue'.
    continue
  # Flip the image horizontally for a later selfie-view display, and convert the BGR image to RGB.
  image = cv2.cvtColor(cv2.flip(image, 1), cv2.COLOR_BGR2RGB)
  # To improve performance, optionally mark the image as not writeable to pass by reference.
  image.flags.writeable = False
  results = hands.process(image)
  # Draw the hand annotations on the image.
  image.flags.writeable = True
  image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
  if results.multi_hand_landmarks:
    for hand_landmarks in results.multi_hand_landmarks:
      mediapipe.solutions.drawing_utils.draw_landmarks(image, hand_landmarks, mediapipe.solutions.hands.HAND_CONNECTIONS)
      cv2.imshow('MediaPipe Hands', image)
  if cv2.waitKey(5) & 0xFF == 27:
    break
hands.close()
cap.release()

Reply all
Reply to author
Forward
0 new messages