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 | |
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 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 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 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 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 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 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); |
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
PImage earth; | |
PShape globe; | |
PGraphics fbo[] = new PGraphics[6]; | |
int cubemapSize = 1024; | |
PImage output_texture; | |
PImage tex; | |
PGraphics view3D,ortho3D; | |
float h, hd2; | |
PVector center[] = { |
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
PImage earth; | |
PShape globe; | |
PGraphics fbo[] = new PGraphics[6]; | |
int cubemapSize = 512; | |
PVector eye = new PVector(0, 0, 0); | |
PVector up[] = { | |
new PVector(0, -1, 0), // +X | |
new PVector(0, -1, 0), // -X |
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 org.apache.commons.math3.geometry.euclidean.threed.Rotation; | |
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; | |
import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; | |
Vector3D focusPoint = latLonToVector3D(0, 0); | |
Vector3D nl = latLonToVector3D(52.37, 4.91); | |
Vector3D ny = latLonToVector3D(40.79, -73.96); | |
Vector3D jp = latLonToVector3D(36.14, 137.86); | |
Vector3D north = latLonToVector3D(90, 0); |
NewerOlder