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 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): |
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 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 |
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
#!/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 |
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 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}") |
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
# 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 |
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
/** | |
* 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. | |
*/ |
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
/** | |
* 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. |
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
# https://blenderartists.org/t/how-to-select-bone-child-objects-in-one-click/660780/16 | |
bl_info = { | |
"name": "Select Siblings", | |
"author": "Stanislav Blinov", | |
"version": (1, 0, 0), | |
"blender": (3, 0, 0), | |
"description": "Select siblings in object mode (respecting distinct bone parents)", | |
"category": "Object", | |
} |
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 numpy as np | |
import open3d as o3d | |
rgb = o3d.io.read_image("rgb_image.jpg") | |
depth = o3d.io.read_image("depth_image.png") | |
#intrinsics = o3d.io.read_pinhole_camera_intrinsic("intrinsics.json") | |
intrinsics = o3d.camera.PinholeCameraIntrinsic(640, 480, fx=525.0, fy=525.0, cx=319.5, cy=239.5) | |
rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(rgb, depth) |
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
javascript:(function(){ | |
const MY_MASTO_LOCAL_DOMAIN = 'front-end.social'; /* 👈 Change this value */ | |
const MY_MASTO_WEB_DOMAIN = MY_MASTO_LOCAL_DOMAIN; /* 👈 Only change this value if your Masto host is hosted an different domain than the LOCAL_DOMAIN */ | |
function tryAndGetUserName() { | |
/* Profile with a moved banner (e.g. https://mastodon.social/@bramus): follow that link */ | |
const userNewProfile = document.querySelector('.moved-account-banner .button')?.getAttribute('href'); | |
if (userNewProfile) { | |
return userNewProfile.substring(2); | |
} |