This file contains hidden or 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 base64 | |
import threading | |
import flet as ft | |
from io import BytesIO | |
from PIL import Image | |
# カメラ映像を定期的にキャプチャして画像を更新 | |
def camera_thread(page: ft.Page, image_control: ft.Image): | |
cap = cv2.VideoCapture(1) |
This file contains hidden or 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 torch | |
from segment_anything import sam_model_registry, SamPredictor | |
import numpy as np | |
from google.colab.patches import cv2_imshow | |
# SAMモデルの読み込み(パスは適宜変更) | |
# sam_checkpoint = "sam_vit_h.pth" | |
sam_checkpoint = "sam_vit_h_4b8939.pth" |
This file contains hidden or 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 pandas as pd | |
import torch | |
from py_irt.models.two_param_logistic import TwoParamLog | |
class SafeTwoParamLog(TwoParamLog): | |
def fit_MCMC(self, models, items, responses, num_epochs=1000): | |
from pyro.infer import MCMC, NUTS | |
nuts_kernel = NUTS(self.model_vague, adapt_step_size=True) | |
hmc_posterior = MCMC( |
This file contains hidden or 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 mido | |
# 利用可能なMIDI入力ポートの一覧を表示 | |
print("利用可能なMIDI入力ポート:") | |
ports = mido.get_input_names() | |
for i, name in enumerate(ports): | |
print(f"{i}: {name}") | |
# # 適切なポート名に置き換えてください(例:"MIDI 1") | |
port_name = mido.get_input_names()[0] |
This file contains hidden or 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
function test(){ | |
var result = getSheetData("001"); | |
Logger.log(result); | |
} | |
function doGet(e) { | |
const keyword = (e.parameter.keyword || "").trim(); | |
if (!keyword) { | |
return ContentService.createTextOutput( | |
JSON.stringify({ error: "No keyword provided" }) |
This file contains hidden or 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 requests | |
import json | |
import flet as ft | |
### Google Apps ScriptのURLを指定 | |
url="ここにGASのURL" | |
def fetch_data(value): | |
global url | |
url2=url+"?keyword=" + value | |
# Google Apps ScriptのURLを指定 |
This file contains hidden or 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 | |
def main(page: ft.Page): | |
page.title = "Flet Sample" | |
name_field = ft.TextField(label="あなたの名前") | |
greeting_text = ft.Text() | |
def greet(e): | |
greeting_text.value = f"Hello, {name_field.value}!" |
This file contains hidden or 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
function doGet(e) { | |
const keyword = (e.parameter.keyword || "").trim(); | |
if (!keyword) { | |
return ContentService.createTextOutput( | |
JSON.stringify({ error: "No keyword provided" }) | |
).setMimeType(ContentService.MimeType.JSON); | |
} | |
result = getSheetData(keyword); |
This file contains hidden or 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 | |
# カメラ情報を設定 | |
username = "" | |
password = "" | |
ip_address = "192.168.1.2" # カメラのIPアドレス | |
port = 80 #httpの場合、 httpsなら445 | |
# カメラによってURLの形式は異なるため、マニュアルやメーカーの仕様書を確認(httpか、httpsか) | |
stream_url = f"http://{username}:{password}@{ip_address}:{port}/axis-cgi/mjpg/video.cgi" |
This file contains hidden or 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 requests | |
import json | |
from datetime import datetime, timezone | |
from base64 import b64encode | |
# Learning Locker LRS のエンドポイント情報 | |
LRS_ENDPOINT = "http://localhost:8081/data/xAPI/statements" | |
LRS_USERNAME = "xxxxxxx" | |
LRS_PASSWORD = "xxxxxx" |
NewerOlder