- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I run "face_recognition_demo" in Windows, I call the camera with the command -i 0, but it takes about 3 minutes from running the program to starting the camera, I don't know what causes it.
The following are the commands used.
python ./face_recognition_demo.py -i 0 -m_fd C:\data\model\face-detection-retail-0004\FP16/face-detection-retail-0004.xml -m_lm C:\data\model\landmarks-regression-retail-0009\FP16/landmarks-regression-retail-0009.xml -m_reid C:\data\model\face-reidentification-retail-0095\FP16/face-reidentification-retail-0095.xml --verbose -fg "C:\data\face_gallery"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hairul
Thank you for your always attentive reply.
I have solved the problem described above and share it with you here.
I added the parameter "cv2.CAP_DSHOW" in the place where CV2 calls the camera.
I changed the code in "images_capture.py".
class CameraCapWrapper(ImagesCapture):
def __init__(self, input, camera_resolution):
self.cap = cv2.VideoCapture()
try:
status = self.cap.open(int(input), cv2.CAP_DSHOW)
self.cap.set(cv2.CAP_PROP_BUFFERSIZE, 1)
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, camera_resolution[0])
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, camera_resolution[1])
self.cap.set(cv2.CAP_PROP_FPS, 30)
self.cap.set(cv2.CAP_PROP_AUTOFOCUS, 1)
self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG'))
......
Regards,
Wu
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi W_qicheng,
Thank you for reaching out to us.
I've ran the Face Recognition Python Demo with my laptop's webcam. The webcam results opens within seconds and successfully ran the demo.
For your information, the results below was using a face gallery that contains only 5 images of Tom Cruise which were labelled Tom-1.jpg, Tom-2.jpg… Tom-5.jpg which amounts to a size of 920 KB. Then, I opened an image of Tom Cruise on my phone and placed it directly in front of the webcam.
Here is the command I used:
python ./face_recognition_demo.py -i 0 -m_fd intel\face-detection-retail-0004\FP16/face-detection-retail-0004.xml -m_lm intel\landmarks-regression-retail-0009\FP16/landmarks-regression-retail-0009.xml -m_reid intel\face-reidentification-retail-0095\FP16/face-reidentification-retail-0095.xml --verbose -fg face_tom
Here are the results:
However, when I used a face gallery dataset of 3000 random face images (3.8 GB) the demo will take 3 minutes before the camera output appears. The command prompt shows "[ INFO ] Building faces database using images from face_gallery" which is due to the demo taking time in building the face gallery database before showing the camera output.
Here is the command prompt message when it is building the face gallery:
You've mentioned that it takes about 3 minutes from running the program to starting the camera. During that period what is the information stated on your command prompt and what is the file size of your face gallery?
Regards,
Hairul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply.
First, to answer your question.
1. There is no prompt during the command run.
2. My face gallery is about 23MB.
Now I have tested each of the following 3 webcams.
1. https://www.logitech.com/en-us/products/webcams/c270-hd-webcam.960-000694.html
2. https://www.logitech.com/en-us/products/webcams/c925e-business-webcam.960-001075.html
3. https://www.logitech.com/en-us/products/webcams/brio-4k-hdr-webcam.960-001105.html
The C270 (USB2.0) starts video immediately, the C925e (USB2.0) and Brio (USB3.0) both take about 3 minutes to start video.
If you know the reasons mentioned above please let me know. Thank you very much.
Regards
W_qicheng
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi W_qicheng,
I've validated the Face Recognition Python Demo using the following webcams:
I did not encounter any issue and the cameras start immediately when executing the demo.
I've ran the demo using the following Open Model Zoo models:
Here is the command that I used:
python ./face_recognition_demo.py -i 0 -m_fd intel\face-detection-retail-0004\FP16/face-detection-retail-0004.xml -m_lm intel\landmarks-regression-retail-0009\FP16/landmarks-regression-retail-0009.xml -m_reid intel\face-reidentification-retail-0095\FP16/face-reidentification-retail-0095.xml --verbose -fg face_tom
For your information, I used a face gallery of 25MB size.
Here is the result for Logitech C925E Business Webcam and the device details:
Here is the result for Logitech C615 Webcam and the device details:
Regards,
Hairul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Hairul
Thanks for your detailed reply.
But I still haven't solved the problem.
Here is the hardware I used and the configuration.
CPU: Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz 3.00 GHz
RAM: 8GB
and I have attached a video of me executing the code.
Regards,
Wu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi W_qicheng,
We have validated again the Face Recognition Python Demo using Logitech C925E Business Webcam and can confirm that this issue is not related to OpenVINO. The Logitech C925E camera starts immediately when executing the demo.
We'd recommend you to test the cameras on different application or system (if available) and observe whether the issue still persists when using the cameras.
From our side, no issues were found when using the Logitech C925E on our system. If the issue still persists, We would suggest you post your query regarding the Logitech C925E video issue in Logitech Community Forum.
On another note, there have been reported issues regarding the Logitech C925E Business Webcam and Logitech Brio Ultra HD Pro Business Webcam on different websites. You can refer to the following article and discussions:
- Fixing picture glitches and freezes on the Logitech BRIO 4K webcam in Windows
- Teams and Logitech c925e Webcam
- c925e and Teams
Regards,
Hairul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi W_qicheng,
This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.
Regards,
Hairul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hairul
Thank you for your always attentive reply.
I have solved the problem described above and share it with you here.
I added the parameter "cv2.CAP_DSHOW" in the place where CV2 calls the camera.
I changed the code in "images_capture.py".
class CameraCapWrapper(ImagesCapture):
def __init__(self, input, camera_resolution):
self.cap = cv2.VideoCapture()
try:
status = self.cap.open(int(input), cv2.CAP_DSHOW)
self.cap.set(cv2.CAP_PROP_BUFFERSIZE, 1)
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, camera_resolution[0])
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, camera_resolution[1])
self.cap.set(cv2.CAP_PROP_FPS, 30)
self.cap.set(cv2.CAP_PROP_AUTOFOCUS, 1)
self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG'))
......
Regards,
Wu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Wu,
Thank you for sharing your solution for the benefit of our Community.
This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.
Regards,
Hairul

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page