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
# best run in an interpreter or with a breakpoint | |
import pickle | |
fn = '' | |
with open(fn, 'rb') as f: | |
a = pickle.load(f) | |
# make edits | |
# breakpoint() |
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
# Save html to the specified path | |
fig.write_html("plotly_sphere_pts.html") | |
# Save to wandb (call wandb.init() first) | |
# html = plotly.io.to_html(fig) | |
# wandb.log( | |
# { | |
# f"plotly_sphere_pts": wandb.Html(html), | |
# } | |
# ) |
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 | |
import trimesh | |
import plotly.graph_objects as go | |
import plotly.figure_factory as ff | |
import numpy as np | |
from voxelized_pointcloud_sampling import create_grid_points_from_bounds | |
import pickle | |
"""Load all meshes and inputs into the same plot to make sure everything is aligned. """ |
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 multiprocessing as mp | |
def process(arguments, res_q): | |
(i,) = arguments | |
res_q.put([i]) | |
max_processes = 2 | |
queue = mp.Queue() |
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://dev.to/adamlombard/how-to-use-the-black-python-code-formatter-in-vscode-3lo0 | |
"python.formatting.provider": "black", | |
"python.formatting.blackPath": "/home/exx/miniconda3/envs/gifs_cloth/bin/black", | |
"editor.formatOnSave": true, | |
} |
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://stackoverflow.com/questions/17241663/filling-a-queue-and-managing-multiprocessing-in-python | |
import time | |
import os | |
import multiprocessing as mp | |
from multiprocessing import Queue, Pool | |
the_queue = Queue() | |
def worker_main(queue): | |
print(f"{os.getpid()} working") |
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
// Softgym Fabric Touch | |
{ | |
"name": "Debug: Sawyer Cloth Env", | |
"type": "python", | |
"request": "launch", | |
"console": "integratedTerminal", | |
"cwd": "/home/exx/projects/IDM/softgym_implicit_cloth_proj", | |
"python": "/home/exx/miniconda3/envs/softgym-ft/bin/python", | |
"program": "/home/exx/projects/IDM/softgym_implicit_cloth_proj/examples/demonstrator.py", | |
"env": { |
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 | |
import sys | |
import pytorch_lightning as pl | |
import pytorch_lightning.utilities.seed as seed_utils | |
from pytorch_lightning import loggers as pl_loggers | |
from pytorch_lightning.callbacks import ModelCheckpoint | |
import hydra | |
import yaml |
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 | |
import rospy | |
import argparse | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from cv_bridge import CvBridge | |
from sensor_msgs.msg import Image | |
class Segmenter(): | |
def __init__(self, args): |
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 matplotlib.pyplot as plt | |
from matplotlib.animation import TimedAnimation | |
class SubplotAnimation(TimedAnimation): | |
def __init__(self, num_steps=50): | |
fig = plt.figure() | |
self.ax1 = fig.add_subplot(2, 1, 1) | |
self.ax2 = fig.add_subplot(2, 1, 2, projection='3d') | |
self.ax2.set(xlim3d=(-1, 1), xlabel='X') |
NewerOlder