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, time, numpy as np, threading | |
| from flask import Flask, Response | |
| from picamera2 import Picamera2 | |
| from ultralytics import YOLO | |
| from pythonosc.udp_client import SimpleUDPClient | |
| TARGET_IP="192.168.0.121" | |
| TARGET_PORT=9000 | |
| OSC_ADDR="/fingertips" | |
| CLASS_NAME="fingertip" |
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
| <label for="large-range" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"> | |
| Large range | |
| </label> | |
| <input id="large-range" type="range" value="50" | |
| class="w-full h-3 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"> | |
| <style> | |
| input[type="range"]::-webkit-slider-thumb { | |
| -webkit-appearance: none; | |
| appearance: none; |
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
| from hua_transkribus import * | |
| user = "hetutrechtsarchief" | |
| term = "vader" | |
| count = get_search_results(user, term) | |
| print("Aantal resultaten:",count) |
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 | |
| def get_framerate(prev_time=[0], fps=[30]): | |
| current_time = cv2.getTickCount() | |
| elapsed = (current_time - prev_time[0]) / cv2.getTickFrequency() | |
| prev_time[0] = current_time | |
| fps[0] = (1.0 / elapsed * 0.1) + (fps[0] * 0.9) | |
| return fps[0] | |
| cam = cv2.VideoCapture(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
| import faiss | |
| import numpy as np | |
| import torch | |
| import torchvision.transforms as transforms | |
| from torchvision import models | |
| from PIL import Image | |
| import os | |
| # --- 1. Load Pre-trained Model (ResNet50) --- | |
| class FeatureExtractor: |
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
| Streamer streamer; | |
| void setup() { | |
| size(640, 600, P3D); | |
| frameRate(60); | |
| background(0); | |
| streamer = new Streamer(400, 400, 8080); | |
| } | |
| void draw() { |
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 org.apache.commons.math3.geometry.euclidean.threed.Rotation; | |
| import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; | |
| PGraphics dome, ortho3D, lens, cubemap[] = new PGraphics[6]; | |
| PShape globe; | |
| PShader shader; | |
| PImage tex; | |
| float h=512, d=h, hd2=h/2, r=hd2; | |
| int cubemapSize=512; | |
| Rotation qTo = new Rotation(new Vector3D(0, 0, 1), 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
| import org.apache.commons.math3.geometry.euclidean.threed.Rotation; | |
| import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; | |
| class GeoPoint extends Vector3D { | |
| float lat, lon; | |
| GeoPoint(float lat, float lon) { | |
| super( | |
| cos(radians(lat)) * sin(-radians(lon)), | |
| sin(radians(lat)), |
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 org.apache.commons.math3.geometry.euclidean.threed.Rotation; | |
| import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; | |
| PGraphics dome, ortho3D, lens, cubemap[] = new PGraphics[6]; | |
| PShape globe; | |
| PShader shader; | |
| PImage tex; | |
| float h=512, d=h, hd2=h/2, r=hd2; | |
| int cubemapSize=512; | |
| Rotation qTo = new Rotation(new Vector3D(0, 0, 1), 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
| import org.apache.commons.math3.geometry.euclidean.threed.Rotation; | |
| import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; | |
| GeoPoint nl = new GeoPoint(52.37, 4.91); | |
| GeoPoint ny = new GeoPoint(40.79, -73.96); | |
| GeoPoint jp = new GeoPoint(36.14, 137.86); | |
| GeoPoint north = new GeoPoint(90, 0); | |
| GeoPoint south = new GeoPoint(-90, 0); | |
| GeoPoint west = new GeoPoint(0,-90); | |
| GeoPoint east = new GeoPoint(0,90); |
NewerOlder