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 openai | |
from openai import OpenAI | |
import os | |
import pandas as pd | |
import time | |
import os | |
def get_completion(prompt): | |
client = OpenAI(api_key='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', ) |
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
conda create --name genai python=3.8 |
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 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
plt.ion() | |
def parse_csv_file(filename): | |
data = [] | |
with open(filename, 'r') as csvfile: | |
reader = csv.reader(csvfile) | |
for row in reader: |
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
# cd /export/ssl-nfs1/shared/datasets/ILC_Gesture_Complex_ILC/processed_data/Hui_708_3/radar_top25_np | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
points=np.load('radar_Hui_right_hand_palm_down_50_dx_0_08_Jul_2022_15_02_08_fft_72.np') | |
RadarPC = points[:,[5,6,7,2,1]] | |
points=RadarPC | |
mask= (points[:,:3]>=0) * (points[:,:3]<=1.0) | |
mask2=mask[:,0]*mask[:,1]*mask[:,2] | |
p=points[mask2] |
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 | |
import seaborn as sns | |
def plot_histogram_with_kde(vector, bins=30): | |
""" | |
Plot a histogram with a Kernel Density Estimate (KDE) on top. | |
Args: | |
- vector (list or ndarray): Data vector. | |
- bins (int): Number of histogram bins. |
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
screen -L -Logfile test.txt -S test | |
screen -XS <session-id> quit |
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 | |
from scipy.io import loadmat | |
import os | |
import glob | |
fullist=glob.glob('/export/ssl-nfs1/shared/datasets/ILC_Gesture_Complex_ILC/processed_data_final/*/radar_top25_np/*.np') | |
np.random.shuffle(fullist) | |
# datlist=np.load('/export/ssl-nfs1/shared/datasets/VLP16TICAMCALIB_HUMAN_SMALL/train_val_aug_18_v1.npy',allow_pickle=True) | |
# fullist=datlist.item()['train']+datlist.item()['val'] |
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
from argparse import Namespace | |
def nested_dict_to_namespace(dictionary): | |
namespace = dictionary | |
if isinstance(dictionary, dict): | |
namespace = Namespace(**dictionary) | |
for key, value in dictionary.items(): | |
setattr(namespace, key, nested_dict_to_namespace(value)) | |
return namespace |
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 visdom | |
from visdom import Visdom | |
import numpy as np | |
import argparse | |
import numpy as np | |
import math | |
import os.path | |
import time | |
import tempfile | |
import urllib |
NewerOlder