cd /home/nvme/dockerdata/prove/face-clustering-rk3588 # Files e dir necessarie per far funzionare prj_root/ ├── bin/ │ └── face_scan ├── lib/ │ └── librknnrt.so ├── models/ │ ├── SCRFD_500M_KPS_640.rknn │ └── face_recognition_sface_2021dec.rknn └── test └── test3f.jpg ### Copia cd /home/nvme/dockerdata/prove/s121js || exit 1 mkdir -p bin lib models cp -f \ /home/nvme/dockerdata/prove/face-clustering-rk3588/lib/librknnrt.so \ lib/ cp -f \ /home/nvme/dockerdata/prove/face-clustering-rk3588/models/SCRFD_500M_KPS_640.rknn \ models/ cp -f \ /home/nvme/dockerdata/prove/face-clustering-rk3588/models/face_recognition_sface_2021dec.rknn \ models/ ### Compilazione make clean make -j"$(nproc)" ### Test delle quattro rotazioni for rotation in 0 90 180 270; do ./bin/face_scan \ --rotation "$rotation" \ test/test3f.jpg \ > "/tmp/rotation_${rotation}.json" \ 2> "/tmp/rotation_${rotation}.stderr" status=$? stderr_bytes=$(wc -c < "/tmp/rotation_${rotation}.stderr") echo \ "rotation=$rotation" \ "status=$status" \ "stderr_bytes=$stderr_bytes" done ### Verifica dimensioni, rotazione e volti python3 - <<'PY' import json from pathlib import Path for rotation in (0, 90, 180, 270): json_path = Path( "/tmp/rotation_" + str(rotation) + ".json" ) data = json.loads( json_path.read_text(encoding="utf-8") ) image = data.get("image") faces = data.get("faces") if not isinstance(image, dict): raise SystemExit( "Campo image non valido per rotazione " + str(rotation) ) if not isinstance(faces, list): raise SystemExit( "Campo faces non valido per rotazione " + str(rotation) ) print( "rotation:", rotation, "size:", str(image.get("width")) + "x" + str(image.get("height")), "json_rotation:", image.get("rotation"), "faces:", len(faces), ) PY