1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/photonix_ynh.git synced 2024-09-03 19:56:29 +02:00

Add face and event processors

This commit is contained in:
Jules Bertholet 2021-06-18 12:46:05 -04:00
parent 0d741abeb3
commit 8cc7097f0e
9 changed files with 70 additions and 11 deletions

View file

@ -9,7 +9,7 @@
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
Photonix is a photo management application that streamlines the process of storing, presenting and re-discovering photos. Smart filtering is made possible automatically by object recognition, location awareness, color analysis and other algorithms.
Photonix is a photo management application that streamlines the process of storing, presenting and re-discovering photos. Smart filtering is made possible automatically by object and face recognition, location awareness, color analysis and other algorithms.
**Shipped version:** 0.9.0

View file

@ -9,7 +9,7 @@
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
## Vue d'ensemble
Photonix est une application de gestion de photos qui simplifie le processus de stocker, présenter er re-découvrir ses photos. Le filtrage intelligent est rendu possible automatiquement grâce à la reconnaissance d'objets, la localisation, l'analyse de couleurs, et d'autres algorithmes.
Photonix est une application de gestion de photos qui simplifie le processus de stocker, présenter er re-découvrir ses photos. Le filtrage intelligent est rendu possible automatiquement grâce à la reconnaissance d'objets et de visages, la localisation, l'analyse de couleurs, et d'autres algorithmes.
**Version incluse :** 0.9.0

View file

@ -0,0 +1,16 @@
[Unit]
Description=Photonix classification_event_processor
After=network.target __APP__-app_server.service
[Service]
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/srv/photonix
EnvironmentFile=__FINALPATH__/photonix.env
ExecStart=/usr/bin/env bash -c "PATH=__FINALPATH__/venv/bin:$PATH sleep 14 && nice -n 19 __FINALPATH__/venv/bin/python __FINALPATH__/srv/photonix/manage.py classification_event_processor"
StandardOutput=append:/var/log/__APP__/__APP__-classification_event_processor.log
StandardError=inherit
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,16 @@
[Unit]
Description=Photonix classification_face_processor
After=network.target __APP__-app_server.service
[Service]
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/srv/photonix
EnvironmentFile=__FINALPATH__/photonix.env
ExecStart=/usr/bin/env bash -c "PATH=__FINALPATH__/venv/bin:$PATH sleep 11 && nice -n 19 __FINALPATH__/venv/bin/python __FINALPATH__/srv/photonix/manage.py classification_face_processor"
StandardOutput=append:/var/log/__APP__/__APP__-classification_face_processor.log
StandardError=inherit
[Install]
WantedBy=multi-user.target

View file

@ -11,6 +11,7 @@ final_path="$(ynh_app_setting_get --app=$app --key=final_path)"
classification_color_enabled=$(ynh_app_setting_get --app=$app --key=classification_color_enabled)
classification_location_enabled=$(ynh_app_setting_get --app=$app --key=classification_location_enabled)
classification_face_enabled=$(ynh_app_setting_get --app=$app --key=classification_face_enabled)
classification_style_enabled=$(ynh_app_setting_get --app=$app --key=classification_style_enabled)
classification_object_enabled=$(ynh_app_setting_get --app=$app --key=classification_object_enabled)
@ -33,7 +34,7 @@ try:
library_path = LibraryPath.objects.get(path='/home/yunohost.multimedia/$username/Picture')
library = library_path.library
except LibraryPath.DoesNotExist:
library = Library(name='$username\'s Personal Library', classification_color_enabled=('$classification_color_enabled' == '1'), classification_location_enabled=('$classification_location_enabled' == '1'), classification_style_enabled=('$classification_style_enabled' == '1'), classification_object_enabled=('$classification_object_enabled' == '1'), setup_stage_completed='Th')
library = Library(name='$username\'s Personal Library', classification_color_enabled=('$classification_color_enabled' == '1'), classification_location_enabled=('$classification_location_enabled' == '1'), classification_face_enabled=('$classification_face_enabled' == '1'), classification_style_enabled=('$classification_style_enabled' == '1'), classification_object_enabled=('$classification_object_enabled' == '1'), setup_stage_completed='Th')
library.save()
library_path = LibraryPath(library=library, type='St', backend_type='Lo', path='/home/yunohost.multimedia/$username/Picture', watch_for_changes=True)
library_path.save()
@ -56,7 +57,7 @@ try:
shared_library_path = LibraryPath.objects.get(path='/home/yunohost.multimedia/share/Picture')
shared_library = shared_library_path.library
except LibraryPath.DoesNotExist:
shared_library = Library(name='Shared Library', classification_color_enabled=('$classification_color_enabled' == '1'), classification_location_enabled=('$classification_location_enabled' == '1'), classification_style_enabled=('$classification_style_enabled' == '1'), classification_object_enabled=('$classification_object_enabled' == '1'), setup_stage_completed='Th')
shared_library = Library(name='Shared Library', classification_color_enabled=('$classification_color_enabled' == '1'), classification_location_enabled=('$classification_location_enabled' == '1'), classification_face_enabled=('$classification_face_enabled' == '1'), classification_style_enabled=('$classification_style_enabled' == '1'), classification_object_enabled=('$classification_object_enabled' == '1'), setup_stage_completed='Th')
shared_library.save()
shared_library_path = LibraryPath(library=shared_library, type='St', backend_type='Lo', path='/home/yunohost.multimedia/share/Picture', watch_for_changes=True)
shared_library_path.save()

View file

@ -54,7 +54,20 @@
"default": true,
"ask": {
"en": "Identify photo locations (medium)?",
"fr": "Identifier la localizations des photos (rapide) ?"
"fr": "Identifier la localizations des photos (moyen) ?"
},
"help": {
"en": "This default parameter can be overridden for individual libraries",
"fr": "Ce paramètre par dèfault peut être modifié pour chaque bibliothèque individuelle"
}
},
{
"name": "classification_face_enabled",
"type": "boolean",
"default": true,
"ask": {
"en": "Identify faces in photos (medium)?",
"fr": "Identifier les visages dans les photos (moyen) ?"
},
"help": {
"en": "This default parameter can be overridden for individual libraries",

View file

@ -116,7 +116,7 @@ function apply_db_migrations {
popd
}
services="app_server watch_photos raw_scheduler raw_processor thumbnail_processor classification_scheduler classification_color_processor classification_location_processor classification_style_processor classification_object_processor rescan_photos_periodically"
services="app_server watch_photos raw_scheduler raw_processor thumbnail_processor classification_scheduler classification_color_processor classification_location_processor classification_face_detection_processor classification_style_processor classification_object_processor classification_event_processor rescan_photos_periodically"
function set_up_logrotate {
local i=0
@ -184,6 +184,7 @@ function load_settings {
port=$(ynh_app_setting_get --app=$app --key=port)
classification_color_enabled=$(ynh_app_setting_get --app=$app --key=classification_color_enabled)
classification_location_enabled=$(ynh_app_setting_get --app=$app --key=classification_location_enabled)
classification_face_enabled=$(ynh_app_setting_get --app=$app --key=classification_face_enabled)
classification_style_enabled=$(ynh_app_setting_get --app=$app --key=classification_style_enabled)
classification_object_enabled=$(ynh_app_setting_get --app=$app --key=classification_object_enabled)
}

View file

@ -28,9 +28,10 @@ path_url="/"
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
classification_color_enabled=$YNH_APP_ARG_CLASSIFICATION_COLOR_ENABLED
classification_location_enabled=$YNH_APP_ARG_CLASSIFICATION_COLOR_ENABLED
classification_style_enabled=$YNH_APP_ARG_CLASSIFICATION_COLOR_ENABLED
classification_object_enabled=$YNH_APP_ARG_CLASSIFICATION_COLOR_ENABLED
classification_location_enabled=$YNH_APP_ARG_CLASSIFICATION_LOCATION_ENABLED
classification_face_enabled=$YNH_APP_ARG_CLASSIFICATION_FACE_ENABLED
classification_style_enabled=$YNH_APP_ARG_CLASSIFICATION_STYLE_ENABLED
classification_object_enabled=$YNH_APP_ARG_CLASSIFICATION_OBJECT_ENABLED
app=$YNH_APP_INSTANCE_NAME
@ -57,6 +58,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=classification_color_enabled --value=$classification_color_enabled
ynh_app_setting_set --app=$app --key=classification_location_enabled --value=$classification_location_enabled
ynh_app_setting_set --app=$app --key=classification_face_enabled --value=$classification_face_enabled
ynh_app_setting_set --app=$app --key=classification_style_enabled --value=$classification_style_enabled
ynh_app_setting_set --app=$app --key=classification_object_enabled --value=$classification_object_enabled
@ -204,7 +206,7 @@ try:
library_path = LibraryPath.objects.get(path='/home/yunohost.multimedia/$username/Picture')
library = library_path.library
except LibraryPath.DoesNotExist:
library = Library(name='$username\'s Personal Library', classification_color_enabled=('$classification_color_enabled' == '1'), classification_location_enabled=('$classification_location_enabled' == '1'), classification_style_enabled=('$classification_style_enabled' == '1'), classification_object_enabled=('$classification_object_enabled' == '1'), setup_stage_completed='Th')
library = Library(name='$username\'s Personal Library', classification_color_enabled=('$classification_color_enabled' == '1'), classification_location_enabled=('$classification_location_enabled' == '1'), classification_face_enabled=('$classification_face_enabled' == '1'),classification_style_enabled=('$classification_style_enabled' == '1'), classification_object_enabled=('$classification_object_enabled' == '1'), setup_stage_completed='Th')
library.save()
library_path = LibraryPath(library=library, type='St', backend_type='Lo', path='/home/yunohost.multimedia/$username/Picture', watch_for_changes=True)
library_path.save()
@ -227,7 +229,7 @@ try:
shared_library_path = LibraryPath.objects.get(path='/home/yunohost.multimedia/share/Picture')
shared_library = shared_library_path.library
except LibraryPath.DoesNotExist:
shared_library = Library(name='Shared Library', classification_color_enabled=('$classification_color_enabled' == '1'), classification_location_enabled=('$classification_location_enabled' == '1'), classification_style_enabled=('$classification_style_enabled' == '1'), classification_object_enabled=('$classification_object_enabled' == '1'), setup_stage_completed='Th')
shared_library = Library(name='Shared Library', classification_color_enabled=('$classification_color_enabled' == '1'), classification_location_enabled=('$classification_location_enabled' == '1'), classification_face_enabled=('$classification_face_enabled' == '1'), classification_style_enabled=('$classification_style_enabled' == '1'), classification_object_enabled=('$classification_object_enabled' == '1'), setup_stage_completed='Th')
shared_library.save()
shared_library_path = LibraryPath(library=shared_library, type='St', backend_type='Lo', path='/home/yunohost.multimedia/share/Picture', watch_for_changes=True)
shared_library_path.save()

View file

@ -55,6 +55,16 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$data_path"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ -z "$classification_face_enabled" ]; then
classification_face_enabled=1
ynh_app_setting_set --app=$app --key=classification_face_enabled --value=$classification_face_enabled
fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================