FacialRecognition

From VentureResearchWiki
Jump to navigation Jump to search

Facial Recognition[edit | edit source]

Document folders:

M:\$$-PRODUCTS\Facial Recognition
M:\$$-CUSTOMERS\FC Background\Facial Recognition 

Hardware[edit | edit source]

Fitlet2 Mini PC[edit | edit source]

​Fitlet2

Assemble Fitlet2 mini pc with components:

  • Fitlet2 with Intel Atom x7-E3950 (​FITLET2-E3950)
  • 30G M.2 MLC SSD (​SFSA030GM1AA1TO-I-LB-216-STD)
  • 4G DDR3 SO-DIMM memory (​CT51264BF160BJ)

Guide to build machine is at M:\$$-PRODUCTS\Facial Recognition\Build\Guide - Build Mini PC 2019-02-28.pdf.

FCT95 Mini PC[edit | edit source]

FCT95 Integrated System:

  • Intel Quad Core ATOM x5 E3940 1.80GHz Processor
  • 8GB 1600MHz SODDR3L Memory
  • 128GB SSD
  • 32GB Onboard eMMC

Software[edit | edit source]

Trueface Offline SDK[edit | edit source]

​SDK

​API Reference

Latest SDK version: 0.3.

SDK release history:

FacialRecognition[edit | edit source]

Main GUI program for facial recognition under Linux using C++, wxWidgets, OpenCV, etc.

Source code: ​http://svn/svn/linux/src/FacialRecognition

Trueface[edit | edit source]

Python3 app to load Trueface offline SDK.

Source code: ​http://svn/svn/linux/py3apps/trueface

Turnstilesync[edit | edit source]

Python3 app to sync database.

Source code: ​http://svn/svn/linux/py3apps/turnstilesync

FacialRec[edit | edit source]

Web ASP.NET server for database sync.

Source code: vrtfs01\VentureResearch\RFIDApplication\Web\FacialRec

Web link: ​http://aries:8280

Steps to Build for FC Background[edit | edit source]

Assemble Fitlet2 Mini PC or FCT95[edit | edit source]

Clone SSD[edit | edit source]

Use ​Clonezilla to clone a disk image on a new SSD. Disk images are saved at ARCHIVE\clonez.

Latest image:

  • 2019-06-06-fitlet2-tf0.3 (Fitlet2)
  • 2021-10-04-fct95-tf0.3 (FCT95)

Image release history:

  • 2018-10-11-fitlet2-tf0.3

Steps to clone:

  1. Start Clonezilla
  2. Select device-image
  3. Select samba_server
  4. Select Ethernet adapter and DHCP
  5. Server: archive (or use IP 10.8.1.13)
  6. Domain: vr-crm
  7. Account: lab
  8. Directory: /clonez
  9. Password: lab1999
  10. Choose the option restoredisk to restore a whole disk

Reboot the PC, then ctrl+F4 to close the app. Open terminal and stop the app temporarily:

systemctl --user stop FacialRecognition.service

Setup[edit | edit source]

If the partition /dev/mmcblk0p1 does not exist, manually create a new partition using the command:

 sudo fdisk /dev/mmcblk0

After clone, boot the min pc, run the second-run script to complete all settings.

Fitlet2:

wget http://readonly:secret@svn.crm.ventureresearch.com/svn/linux/testing/fcb/fcb-secondrun-fitlet2.sh -O ~/Downloads/fcb-secondrun-fitlet2.sh
bash ~/Downloads/fcb-secondrun-fitlet2.sh

FCT95:

wget http://readonly:secret@svn.crm.ventureresearch.com/svn/linux/testing/fcb/fcb-secondrun-fct95.sh -O ~/Downloads/fcb-secondrun-fct95.sh
bash ~/Downloads/fcb-secondrun-fct95.sh

Port Forwarding[edit | edit source]

Find external IP:

curl ifconfig.me

Go to the Digi configure page like: ​https://xxx.xxx.xxx.xxx:8443 with the user name: admin, password: party101. Then go to Configuration - Network > IP Routing/Forwarding > IP Port Forwarding/Static NAT Mappings, add port forwarding for 10.10.10.20:22 to external port 4444.

Remote Access[edit | edit source]

DISPLAY=:0 x11vnc &

Then log in with TightVNC Viewer.

Preship[edit | edit source]

Change password to party101:

passwd

Disable Auto-Update:

  • set Prompt=never in
sudo vi /etc/update-manager/release-upgrades
sudo sed -i 's/Prompt=lts/Prompt=never/g' /etc/update-manager/release-upgrades
  • add # in front of DPkg in
sudo vi /etc/apt/apt.conf.d/99update-notifier
sudo sed -i 's/DPkg/#DPkg/g' /etc/apt/apt.conf.d/99update-notifier
  • set all values from "1" to "0" in
sudo vi /etc/apt/apt.conf.d/10periodic
sudo sed -i 's/"1"/"0"/g' /etc/apt/apt.conf.d/10periodic

Disable Crash Report:

sudo rm /var/crash/*
sudo sed -i 's/enabled=1/enabled=0/g' /etc/default/apport

Fix the VPN if the device is NOT on ​devicevpn page:

sudo curl http://downloads.ventureresearch.com/VRReader/OpenVPN/deploy-vpn.sh | sudo bash

Setup data purge:

cd /home/venture/working/FacialRecognition/utils
svn update
crontab -l | { cat; echo "0 3 * * * bash /home/venture/working/FacialRecognition/utils/fr-archive.sh"; } | crontab -

Setup reboot at 2:00AM to avoid the issue of USB camera:

sudo crontab -l | { cat; echo "* 2 * * * /sbin/reboot"; } | sudo crontab -

Setup check the status of USB camera every 5 minutes, and send the email if failed:

sudo apt install ssmtp mailutils -y
cd /home/venture/working/FacialRecognition/utils
svn update
sudo cp /home/venture/working/FacialRecognition/utils/ssmtp.conf /etc/ssmtp/ssmtp.conf
sudo sed -i "/hostname=/c\hostname=$(hostname)" /etc/ssmtp/ssmtp.conf
cp /home/venture/working/FacialRecognition/utils/checkcamera.service /home/venture/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable checkcamera
systemctl --user start checkcamera

Setup data copy from entry pc to exit pc:

Login to the entry facial rec pc, run the commands

wget http://readonly:secret@svn.crm.ventureresearch.com/svn/linux/testing/fcb/clone-subjects.sh -O /home/venture/clone-subjects.sh
chmod +x clone-subjects.sh
ssh-keygen
ssh-copy-id venture@10.10.10.21
crontab -l | { cat; echo "* * * * * /home/venture/clone-subjects.sh"; } | crontab -

Insert the IP address of the OpenVPN:

sudo sed -i 's/^remote 24.153.205.116 1194/#remote 24.153.205.116 1194/g' /etc/openvpn/venture.conf
echo "" >> /etc/openvpn/venture.conf
echo "remote 24.153.205.116 1194 tcp" >> /etc/openvpn/venture.conf

FC Background EntryExit Facial Recognition[edit | edit source]

FCBackground-SetupEntryExitFacialRec