- ARM 64 (aarch64)
- gcc 7.3
- cuda 10
- cudnn 7
- v1.12.0
import numpy as np | |
def perspective_fov(fov, aspect_ratio, near_plane, far_plane): | |
num = 1.0 / np.tan(fov / 2.0) | |
num9 = num / aspect_ratio | |
return np.array([ | |
[num9, 0.0, 0.0, 0.0], | |
[0.0, num, 0.0, 0.0], | |
[0.0, 0.0, far_plane / (near_plane - far_plane), -1.0], | |
[0.0, 0.0, (near_plane * far_plane) / (near_plane - far_plane), 0.0] |
// licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/ | |
await loadScript("https://unpkg.com/latk@1.0.3/latk.js") | |
latk = Latk.read("https://raw.githubusercontent.com/LightningArtist/latk-test-files/main/latk_logo.latk") | |
p = new P5({mode: 'WEBGL'}) // loads p5js library, comment this line after using it once | |
p.hide() // hide p5js canvas. | |
counter = 0 | |
marktime = 0 |
import csv | |
with open("tiltset_credits_unique_13908_cleaned.csv", "r") as file: | |
csv_reader = csv.reader(file) | |
extra_comma_counter = 0 | |
for i, line in enumerate(csv_reader): | |
num_commas = len(line) - 1 | |
if (num_commas > 1): |
import torch | |
import onnxruntime as ort | |
torch.cuda.is_available() # Nvidia or AMD GPU | |
torch.backends.mps.is_available() # Apple GPU | |
ort.get_device() # any GPU |
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
import os | |
with open("names.txt", "r") as file: | |
lines = file.readlines() | |
for line in lines: | |
folder_name = line.strip().replace(" ", "_") | |
os.makedirs(folder_name, exist_ok=True) | |
print(f"Created folder: {folder_name}") |
# https://subscription.packtpub.com/book/data/9781788474443/9/ch09lvl1sec12/restoring-a-3d-point-from-two-observations-through-triangulation | |
import cv2 | |
import numpy as np | |
# camera projection matrices | |
P1 = np.eye(3, 4, dtype=np.float32) | |
P2 = np.eye(3, 4, dtype=np.float32) | |
P2[0, 3] = -1 |
/** | |
* Resize the image to a new width and height using nearest neigbor algorithm. To make the image scale | |
* proportionally, use 0 as the value for the wide or high parameter. | |
* For instance, to make the width of an image 150 pixels, and change | |
* the height using the same proportion, use resize(150, 0). | |
* Otherwise same usage as the regular resize(). | |
* | |
* Note: Disproportionate resizing squashes the "pixels" from squares to rectangles. | |
* This works about 10 times slower than the regular resize. Any suggestions for performance increase are welcome. | |
*/ |
/** | |
* Resize the image to a new width and height using nearest neighbor algorithm. | |
* To make the image scale proportionally, | |
* use 0 as the value for the wide or high parameters. | |
* For instance, to make the width of an image 150 pixels, | |
* and change the height using the same proportion, use resize(150, 0). | |
* Otherwise same usage as the regular resize(). | |
* | |
* Note: Disproportionate resizing squashes "pixels" from squares to rectangles. | |
* This works about 10 times slower than the regular resize. |