Commit 1afa3723 authored by klorydryk's avatar klorydryk
Browse files

Supprimer anciens fichiers de noms/prénoms

parent fff3fc0a
This diff is collapsed.
This diff is collapsed.
import random
import string
# English names
fo = open("words", "r")
long_txt = fo.read()
words = long_txt.splitlines()
# French firstnames https://www.data.gouv.fr/fr/datasets/liste-de-prenoms/
#fo_firstname = open("Prenoms.csv", "r", encoding='Windows 1252')
#fo_firstname = open("Prenoms.csv", "r", encoding='latin-1')
......
#!/usr/bin/env python3
'''
Author: Guido Diepen <gdiepen@deloitte.nl>
Author: Benoît Piédallu < benoit@laquadrature.net>
Based on Guido Diepen <gdiepen@deloitte.nl> work
'''
#Import the OpenCV and dlib libraries
......@@ -11,6 +12,7 @@ from colour import Color
from threading import Thread
import time
import random
# import tkinter as tk
import randomnames
......@@ -76,9 +78,9 @@ def list_available_cameras():
class facetracker:
#We are not doing really face recognition
def doRecognizePerson(self, faceNames, fid):
time.sleep(2)
faceNames[ fid ] = randomnames.rand_name(charset) #"Person " + str(fid)
# def doRecognizePerson(self, faceNames, fid):
# time.sleep(2)
# faceNames[ fid ] = randomnames.rand_name_statistic(charset) #"Person " + str(fid)
def displayGradientOn(self, resultImage, value, vertical=False):
red = Color("red")
......@@ -472,7 +474,7 @@ class facetracker:
# Directly add name + pass a charset to which name must belong
# "Person " + str(fid)
self.faceNames[ self.currentFaceID ] = randomnames.rand_name("letters")
self.faceNames[ self.currentFaceID ] = randomnames.rand_name_statistic("letters")
self.calculateAverageSuspicious(self.faceSuspicion)
......@@ -557,33 +559,26 @@ class facetracker:
if __name__ == '__main__':
cameraList = []
for camera_id in list_available_cameras():
# root = tk.Tk()
# screen_width = root.winfo_screenwidth()
# screen_height = root.winfo_screenheight()
# print("Taille écran: " + str(screen_width) + "x" + str(screen_height) )
camera_list = list_available_cameras()
# if screen_width>screen_height:
# if len(camera_list) == 1:
# window_height = screen_height
facetrackerList = []
for camera_id in camera_list:
videoName = "cam" + str(camera_id)
cameraList.append(facetracker(camera_id, videoName))
facetrackerList.append(facetracker(camera_id, videoName))
while True:
try:
for camera in cameraList:
for camera in facetrackerList:
camera.show_frame()
except AttributeError:
pass
# thread = Thread(target=camera.test_display_cam, args=(cam_disp))
# cam_threads.append(thread)
# thread.deamon = True
# thread.start()
# thread = Thread( target=camera.detectAndTrackMultipleFaces, args={
# # False: Names are directly printed on screen, no new thread
# 'start_thread' : False,
# # Select only names with letters and whitespace. Any other value will select printable.
# 'charset' : "letters",
# # If True, then rectangle color around people' face will turn red if dangerous
# 'draw_person_dangerosity' : True,
# # Add a warning message if dangerous
# 'add_warning_message' : True,
# })
# thread.start()
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment