This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import pykinect_azure as pykinect | |
from tkinter import filedialog | |
# ファイル選択ダイアログを表示し、動画ファイルを選択 | |
video_filename = filedialog.askopenfilename(filetypes=[("動画ファイル", "*.mkv")]) | |
# ライブラリを初期化する | |
pykinect.initialize_libraries(track_body=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import pykinect_azure as pykinect | |
from tkinter import filedialog | |
# ファイル選択ダイアログを表示し、動画ファイルを選択 | |
video_filename = filedialog.askopenfilename(filetypes=[("動画ファイル", "*.mkv")]) | |
# ライブラリを初期化する | |
pykinect.initialize_libraries(track_body=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import pykinect_azure as pykinect | |
from tkinter import filedialog | |
# ファイル選択ダイアログを表示し、動画ファイルを選択 | |
video_filename = filedialog.askopenfilename(filetypes=[("動画ファイル", "*.mkv")]) | |
# ライブラリを初期化する |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def removeStudentNameInFile(directory): | |
""" | |
Googleフォームで投稿されたファイルから学生の名前を削除する | |
Args: | |
directory (str): ファイルが保存されているディレクトリのパス | |
""" | |
# ディレクトリ内のすべてのファイルを処理 | |
for filename in os.listdir(directory): | |
# " - "の位置を検索 | |
pos = filename.find(" - ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import mediapipe as mp | |
mp_face_mesh = mp.solutions.face_mesh | |
face_mesh = mp_face_mesh.FaceMesh(static_image_mode=False, max_num_faces=1, min_detection_confidence=0.5, min_tracking_confidence=0.5) | |
mp_drawing = mp.solutions.drawing_utils | |
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radius=1) | |
cap = cv2.VideoCapture(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import uuid | |
from bleak import BleakScanner, BleakClient | |
from bleak.exc import BleakError | |
device_name = "ESP32" | |
read_UUID = uuid.UUID("6E400003-B5A3-F393-E0A9-E50E24DCCA9E") | |
async def ble_scan(): | |
devices = await BleakScanner.discover() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from bleak import BleakScanner, BleakClient | |
ADDRESS = None | |
async def ble_scan(): | |
global ADDRESS | |
device_name = "ESP32" | |
devices = await BleakScanner.discover() | |
target_device = next((d for d in devices if d.name == device_name), None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import FlutterMacOS | |
@NSApplicationMain | |
class AppDelegate: FlutterAppDelegate { | |
override func applicationDidFinishLaunching(_ notification: Notification) { | |
let controller : FlutterViewController = mainFlutterWindow?.contentViewController as! FlutterViewController | |
let shellChannel = FlutterMethodChannel(name: "shell_executor", | |
binaryMessenger: controller.engine.binaryMessenger) | |
shellChannel.setMethodCallHandler({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flet as ft | |
import os | |
#絶対パスで指定する場合 | |
#カレントディレクトリを取得 | |
#cDir=os.getcwd() | |
#img1=cDir+"/kdix.jpg" | |
#img2=cDir+"/icore.jpg" | |
#相対パスで指定する場合 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fletで複数のViewを遷移する例 | |
# 参考サイトhttps://zenn.dev/yuki6flower/articles/ca145854ed55b3 | |
import flet as ft | |
class Top(ft.View): | |
def __init__(self): #コンストラクタ | |
data = "Top data" | |
controls = [ | |
ft.AppBar(title=ft.Text("Top view"), bgcolor=ft.colors.SURFACE_VARIANT), | |
ft.TextField(value=data, on_change=self.changed), |
NewerOlder