
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (58)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (7325)
-
Bash script having custom functions not running under systemd service
13 août, par nightcrawlerI have this script to get images from a webcam & process them via RKNN NPU


#!/bin/bash

# Define the temporary directory for images
TEMP_DIR="/media/32GB/pics"
# Define the resize/letterbox option
RESIZE_OPTION="letterbox" # or "letterbox" depending on your requirement
# Define the output image path pattern
OUTPUT_IMAGE_PATH="/media/32GB/processed_pics/%Y-%m-%d_%H-%M-%S_processed.jpg"
# Define the path to the rknn_yolov5_demo_Linux binar
BINARY_PATH="$HOME/ezrknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux"
# Define ntfy variables
NTFY_URL="https://ntfy.org/ho"
NTFY_USER="xxx"
NTFY_PASS="xxxx"

# Empty existing content
rm "$TEMP_DIR"/*
# Function to run ffmpeg and write images to temporary files
run_ffmpeg() {
 v380 -u xxxx -p xxxx -addr 192.168.1.xxx | ffmpeg -i - -f image2 -vf fps=3 -strftime 1 "$TEMP_DIR/%Y-%m-%d_%H-%M-%S_cap.jpg" -y
}

# Function to run rknn_yolov5_demo_Linux and process images from temporary files
run_rknn_yolov5_demo() {
 while true; do
 # Find the most recent image file in the temporary directory
 IMAGE_PATH=$(ls -t "$TEMP_DIR"/*.jpg | head -n 1)

 # Check if the image path is not empty
 if [ -n "$IMAGE_PATH" ]; then
 # Define the output image path
 OUTPUT_IMAGE=$(date +"$OUTPUT_IMAGE_PATH")

 # Change to the binary directory and set LD_LIBRARY_PATH
 DETECTION_OUTPUT=$(cd "$BINARY_PATH" && LD_LIBRARY_PATH=./lib ./rknn_yolov5_demo ./model/RK3566_RK3568/yolov5s-640-640.rknn "$IMAGE_PATH" "$RESIZE_OPTION" "$OUTPUT_IMAGE")

 # Check if the detection output contains the word "person"
 if echo "$DETECTION_OUTPUT" | grep -q "person"; then
 echo "Human detected. Saving processed image to $OUTPUT_IMAGE"
 rm "$IMAGE_PATH"
 # Upload the image using the imgur binary and capture the link
 UPLOAD_OUTPUT=$(imgur "$OUTPUT_IMAGE")
 UPLOAD_LINK=$(echo "$UPLOAD_OUTPUT" | grep -m 1 '^http')

 if [ -n "$UPLOAD_LINK" ]; then
 echo "Image uploaded successfully. Link: $UPLOAD_LINK"
 # Send ntfy notification with the image link
 curl -u $NTFY_USER:$NTFY_PASS -H "tags:rotating_light" -H "Attach:$UPLOAD_LINK" -d "Human detected" $NTFY_URL
 else
 echo "Failed to upload image."
 fi
 else
 rm "$OUTPUT_IMAGE"
 rm "$IMAGE_PATH"
 fi
 fi

 # Sleep for a short period to avoid high CPU usage
 sleep 1
 done
}


# Run ffmpeg and rknn_yolov5_demo_Linux in the background
run_ffmpeg &
run_rknn_yolov5_demo &



& the corresponding .service file


[Unit]
Description=Process Images with rknn_yolov5_demo
After=network.target
#StartLimitIntervalSec=60
#StartLimitBurst=5

[Service]
Type=simple
ExecStartPre=/bin/sleep 30
ExecStart=/home/xxx/process_images_rknn.sh
Restart=always
RestartSec=3
TimeoutStartSec=60

[Install]
WantedBy=default.target



Now last x2 lines of script are creating problems.


Case1] If I keep like this
htop
shows no initiation offfmpeg
norrknn
Binaries

Case2] I removed
&
from both lines then onlyffmpeg
runs butrknn
is nowhere inhtop


Case3] Only this case works


run_ffmpeg &
run_rknn_yolov5_demo



I am reloading systemctl daemon & restarting service after script modification in each case


-
Evolution #4080 : Raccourci puce : se débarasser de l’image
1er octobre 2018Je vote pour le caractère
https://unicode-table.com/fr/2023/Voici un test chez moi en local sur SPIP 3.2, la dist et Firefox Windows (bref 100% vanille)
-
Revision 28933 : on bouge
31 mai 2009, par ben.spip@… — Logon bouge