Пример #1
0
def get_images():
    clear_folder(datasetPath + "images")
    clear_folder(datasetPath + "projections")
    try:
        uploaded_files = request.files.getlist("file[]")
        for idx, file in enumerate(uploaded_files):
            file.save(dst=datasetPath + "images/" + file.filename + ".jpg")

        camera.main(datasetPath)
        pmvs.main(datasetPath)
        mesh.main("expansion_pointcloud.ply")
        print('DONE')
    except:
        print(exc_info())
        return jsonify({"message": "fail"})
    return jsonify({"message": "done"})
Пример #2
0
 def play_move(self):
     computer_move = get_computer_move()
     human_move = camera.main()
     winner = get_match_winner(human_move, computer_move)
     if winner == -1:
         self.human_wins += 1
     elif winner == 1:
         self.computer_wins += 1
     self.games_played += 1
     result = {1: "LOSE", 0: "TIE", -1: "WIN"}[winner]
     self.win_lose_text.setText(
         f"You played {get_full_move(human_move).upper()} "
         f"and the computer played {get_full_move(computer_move).upper()} "
         f"which means you {result}!\n\n"
         f"Computer wins: {self.computer_wins}\n"
         f"Human wins: {self.human_wins}\n"
         f"Games played: {self.games_played}")
     self.win_lose_text.adjustSize()
 def callback():
     #camera.main(camera.parse_arguments(['ALL', 'pre-trained/20170512-110547.pb', 'classifier.pkl', '--interval=1', '--minsize=80', self]))
     camera.main('ALL', 'pre-trained/20170512-110547.pb',
                 'classifier.pkl', 3, 80, captureMode, self)
Пример #4
0
 def callback():            
     camera.main('ALL', 'pre-trained/20170512-110547.pb', 'classifier.pkl', 1, 80, captureMode, self)
Пример #5
0
import os
import face_recognition
import camera, time

dataset = os.listdir('images')

count = 0

current_image = camera.main()
print("Image obtained...")
print()
#print(current_image)
#current_image=face_recognition.load_image_file('images/'+dataset[7])
encoded_current_image = face_recognition.face_encodings(current_image)
#print(encoded_current_image)
print("Authenticating...")

for image in dataset:
    check_image = face_recognition.load_image_file('images/' + image)
    faces = face_recognition.face_encodings(check_image)

    for face in faces:
        encoded_check_image = face
        #print(encoded_check_image)

        result = face_recognition.compare_faces(encoded_current_image,
                                                encoded_check_image)
        #print(result)

        if len(result) == 0:
            continue
Пример #6
0
def detect():
    return Response(gen2(main()),
                    mimetype='multipart/x-mixed-replace; boundary=frame')
Пример #7
0
def video_feed():
    return Response(gen(main()),
                    mimetype='multipart/x-mixed-replace; boundary=frame')
Пример #8
0
import camera
import painter

camera.main()
painter.main()