Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Core/UI/Images/icons/kiri_smug.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bqosafyakp6kp"
path="res://.godot/imported/kiri_smug.png-3779d780d643bd959b80f9294c1515ce.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Core/UI/Images/icons/kiri_smug.png"
dest_files=["res://.godot/imported/kiri_smug.png-3779d780d643bd959b80f9294c1515ce.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
42 changes: 37 additions & 5 deletions Mods/MediaPipe/_tracker/Project/new_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import mediapipe
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
import os
# this has to be set before cv2 is imported
# https://github.com/opencv/opencv/issues/17687
os.environ["OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS"] = "0"

import cv2
import time
import json
Expand All @@ -14,7 +19,6 @@
from kiri_math import lerp

import socket
import os
import sys

import psutil
Expand Down Expand Up @@ -797,6 +801,11 @@ def enumerate_camera_devices():
if sys.platform == "linux":
capture_api_preference = cv2.CAP_V4L2

# CAP_ANY provides a Direct Show(DSHOW) backend and a Media Foundation(MSMF) backend
# MSMF is more modern and DSHOW maybe removed in any future version of windows so filter by MSMF
if sys.platform == "win32":
capture_api_preference = cv2.CAP_MSMF

# On Linux, we sometimes see stuff showing up as just "video#", so
# let's at least try to correlate paths and IDs from
# /dev/v4l/by-id .
Expand All @@ -812,9 +821,11 @@ def enumerate_camera_devices():
pass

all_camera_data = []

for camera_info in enumerate_cameras(apiPreference=capture_api_preference):

cameras = enumerate_cameras(apiPreference=capture_api_preference)
if sys.platform == "win32" and len(cameras) == 0:
capture_api_preference = cv2.CAP_DSHOW
cameras = enumerate_cameras(apiPreference=capture_api_preference)
for camera_info in cameras:
camera_name = camera_info.name

if re.match("video[0-9]+", camera_info.name):
Expand All @@ -836,6 +847,27 @@ def enumerate_camera_devices():
"index" : camera_info.index
}

all_camera_data.append(camera_data)
if sys.platform == "linux":
from linuxpy.video.device import Device, VideoCapture

cap = cv2.VideoCapture(camera_info.index, capture_api_preference)
works = False
if cap.isOpened():
ret, frame = cap.read()
if ret and frame is not None:
works = True
else:
with Device(camera_info.path) as camera:
try:
for frame in camera:
pass
except OSError as e:
if e.errno == 16:
works = True
cap.release()
if works:
all_camera_data.append(camera_data)
else:
all_camera_data.append(camera_data)

return all_camera_data
2 changes: 1 addition & 1 deletion Mods/MediaPipe/_tracker/Project/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ mediapipe==0.10.14
psutil==6.0.0
cv2-enumerate-cameras==1.1.18.2
numpy==1.26.0

linuxpy==0.23.0; sys_platform == "linux"
24 changes: 12 additions & 12 deletions addons/KiriPythonRPCWrapper/platform_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@
"Linux-arm64": {
"complete_filename": "cpython-3.12.7+20241016-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz",
"download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20241016/cpython-3.12.7%2B20241016-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz",
"file_size": 17865102,
"file_size": 17865102.0,
"sort": "cpython-00000003-00000012-00000007-20241016-aarch64-unknown-linux-gnu-install_only_stripped-tar-gz"
},
"Linux-x86_64": {
"complete_filename": "cpython-3.12.5+20240814-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz",
"download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5%2B20240814-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz",
"file_size": 21984711,
"file_size": 21984711.0,
"sort": "cpython-00000003-00000012-00000005-20240814-x86_64-unknown-linux-gnu-install_only_stripped-tar-gz"
},
"Windows-x86_64": {
"complete_filename": "cpython-3.12.5+20240814-x86_64-pc-windows-msvc-shared-install_only_stripped.tar.gz",
"download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5%2B20240814-x86_64-pc-windows-msvc-shared-install_only_stripped.tar.gz",
"file_size": 23569213,
"file_size": 23569213.0,
"sort": "cpython-00000003-00000012-00000005-20240814-x86_64-pc-windows-msvc-shared-install_only_stripped-tar-gz"
},
"macOS-x86_64": {
"complete_filename": "cpython-3.12.5+20240814-x86_64-apple-darwin-install_only_stripped.tar.gz",
"download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5%2B20240814-x86_64-apple-darwin-install_only_stripped.tar.gz",
"file_size": 16564547,
"sort": "cpython-00000003-00000012-00000005-20240814-x86_64-apple-darwin-install_only_stripped-tar-gz"
},
"macOS-arm64": {
"complete_filename": "cpython-3.12.5+20240814-aarch64-apple-darwin-install_only_stripped.tar.gz",
"download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5%2B20240814-aarch64-apple-darwin-install_only_stripped.tar.gz",
"file_size": 16223961,
"file_size": 16223961.0,
"sort": "cpython-00000003-00000012-00000005-20240814-aarch64-apple-darwin-install_only_stripped-tar-gz"
},
"macOS-x86_64": {
"complete_filename": "cpython-3.12.5+20240814-x86_64-apple-darwin-install_only_stripped.tar.gz",
"download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5%2B20240814-x86_64-apple-darwin-install_only_stripped.tar.gz",
"file_size": 16564547.0,
"sort": "cpython-00000003-00000012-00000005-20240814-x86_64-apple-darwin-install_only_stripped-tar-gz"
}
},
"requirements": "mediapipe==0.10.14\npsutil==6.0.0\ncv2-enumerate-cameras==1.1.18.2\nnumpy==1.26.0\n\n"
}
"requirements": "mediapipe==0.10.14\npsutil==6.0.0\ncv2-enumerate-cameras==1.1.18.2\nnumpy==1.26.0\nlinuxpy==0.23.0; sys_platform == \"linux\"\n"
}