- Создал(а) Aleksandr Savkin, редактировал(а) Vasily Selivantsev июн. 04, 2025
Main features
This script that allows to:
- Import: add persons from prepared photos while preserving the structure and names of folders to the database of persons.
- Export: export the database of persons with the preservation of the structure, folder names, contact information and comments about the persons.
Possibilities:
- Adding many persons at once to both Trassir OS and Windows servers.
- Choosing a person's name and gender.
- Saving all persons to the screenshots folder in the form of photos.
- Exporting by schedule.
- Sending exported files on e-mail.
- Sending exported files on FTP.
Importing photos to the persons database.
How the photo file has to be named:
{Name and Surname}_{gender}_{year-month-day}.jpg
Where:
- {Name and surname} - Name and surname of the person without underscore.
- {gender} - Gender of the person. Possible are: male, female, other.
It is possible to not specify the gender, but that way the gender for a person will be set to male, as a default value.
Making a mistake in typing gender will lead to setting up the male gender to a person. - {year-month-day} - Birthdate of the person. Note the hyphen symbol.
It is possible to not specify the birthdate.
Making a mistake in typing birthdate will not import the person. - .jpg - picture format which the script is working with
Examples:
For Windows TRASSIR Server:
- Place photo files in a separate folder on Windows PC, on which Windows TRASSIR Server is running
- In the 'Type of work' field of the script settings on the Server, select import
- In 'Source to import' filed specify the full path to the folder
- Click 'Save and Run' and enable the script, if it was disabled
For TrassirOS Server:
Option 1, using WinSCP software
- Use this instruction - How to enable SSH connection on TRASSIR NVRs
- Connect to the server using WinSCP software. Username vms and password of the admin user (by default is 12345, but strongly recommended to change it)
Create a folder for uploading photos:
Open up the terminal in WinSCP (Shift+Ctrl+T) and enter and excute the command:sudo mkdir /media/VmsArchive/Faces && sudo chmod 777 /media/VmsArchive/Faces
In the right side of the WinSCP window, navigate to /media/VmsArchive/Faces . Or simply press "Ctrl+O", and paste "/media/VmsArchive/Faces" there, press OK or Enter:
- On the left side of WinSCP, navigate to the folder with photos on the PC. Drag'n'drop the files from left side to the right side:
- Install the script on the Server
- In script settings, set the "Type of work" to "import"
- In "source to import" specify the path to the folder on the server - /media/VmsArchive/Faces
- Press "Save" / "Save and Run" and enable the script, if it was disabled
Option 2, using the operator's mode template
- Open Operator interface (Be sure that TRASSIR Client is working, press on the red triangle and choose the monitor)
- Create New template:
- Expand the Template editor window (blue triangle), and click on or drag'n'drop following separator:
- The operator window now will separate on two equal parts. Drag'n'drop "File Manager" on both sides, then click on "Save As...", choose a name for the template
- On the left side of the operator window, navigate to the folder with photos on Windows PC, on the right side - choose the screenshots folder of the required server
- On the right side of the operator window, click with right mouse button and choose "Create directory":
- Open the created directory
- Drag'n'drop the files from the left side to the right side of the operator window
- Install the script on the Server
- In script settings, set the "Type of work" to "import"
- In "source to import" specify the path to the screenshots folder on the server - /mnt/LocalStorage/shots/photos/
- Press "Save" / "Save and Run" and enable the script, if it was disabled
Exporting photos of persons to the screenshots folder.
- In the Type of work field, select "export"
- Click "Save" / "Save and Run" and enable the script, if it was disabled
- Proceed to Server Settings → Screenshots
- Find the folder with a name "face_from_folder_{date and time of export}"
open it and there will be the exported photos and .scv file with persons info (if the checkbox "Export contact info and comments to csv" was enabled in the script settings)
CSV update persons
Main functions
Adding information about persons in the fields "Note" and "Contact information" from a .csv document encoded in UTF-8.
CSV File preparation
The file structure should look like this:
Example .csv file - csv_example.csv
It is also possible to edit the file in notepad:
CSV File upload
Option 1, using WinSCP software
- Use this instruction - How to enable SSH connection on TRASSIR NVRs
- Connect to the server using WinSCP software. Username vms and password of the admin user (by default is 12345, but strongly recommended to change it)
- In the right side of the WinSCP window, navigate to /media/VmsArchive/Faces . Or simply press "Ctrl+O", and paste "/mnt/LocalStorage/shots" there, press OK or Enter:
- On the left side of WinSCP, navigate to the folder with csv file on the PC. Drag'n'drop the files from left side to the right side:
- Install the script on the Server
- See down below for the script settings
Option 2, using the operator's mode template
- Open Operator interface (Be sure that TRASSIR Client is working, press on the red triangle and choose the monitor)
- Create New template:
- Expand the Template editor window (blue triangle), and click on or drag'n'drop following separator:
- The operator window now will separate on two equal parts. Drag'n'drop "File Manager" on both sides, then click on "Save As...", choose a name for the template
- On the left side of the operator window, navigate to the folder with csv file on Windows PC, on the right side - choose the screenshots folder of the required server
- Drag'n'drop the csv file from the left side to the right side
- See down below for the script settings
Script settings
File name - the name of the .csv file must be specified along with the extension.
Column with name - the parameter in which the column with the full name of the person is specified is a mandatory parameter. In our example it is "Employee".
Columns to comment - a parameter in which you can specify columns from the file (separated by commas ","), which should be entered in the information about the persons in the "Note" section, is not a mandatory parameter. In our example it is "Post".
Columns to contact info - the parameter in which you can specify the columns from the file (separated by commas ","), which should be entered in the information about the person in the "Contact information" section, is not a mandatory parameter. In our example it is "department".
Only one person with full name - by default, False, if set to True - when finding identical persons, the script will not change information about them.
Debug - debugging mode. The script log will be recorded in a separate file that is created in the "Screenshots" folder.
- Нет меток