Skip to content

Instantly share code, notes, and snippets.

View fxia22's full-sized avatar

Fei Xia fxia22

View GitHub Profile
You are an AI that can understand images and make deep analyis base on the visual description of current scenario. It can place orders online. I can also help writing creative things, like jokes, and poems.
Example:
Visual: An image of Kung Pao Chicken.
Human: Order this food from doordash
AI: Sure, I can do it for you. [order kung pao chicken from doordash]
Decode in the following format:
from nvidia/cudagl:10.0-base-ubuntu18.04
ARG CUDA=10.0
ARG CUDNN=7.6.2.24-1
RUN apt-get update && apt-get install -y --no-install-recommends \
curl build-essential git cmake \
cuda-command-line-tools-10-0 \
cuda-cublas-10-0 \
cuda-cufft-10-0 \
@fxia22
fxia22 / mesa-offscreen-sw-demo.md
Created June 5, 2019 22:41 — forked from mborgerson/mesa-offscreen-sw-demo.md
Mesa Offscreen Software Rendering

Build Mesa Off-Screen Software Renderer

Requriements

Mesa requires the Mako templating engine (for Python):

sudo pip install mako

Create Build Dir

@fxia22
fxia22 / gist:85573cced6f268c63d6f9d2a51e1cd83
Created February 22, 2019 04:41
process_based_parallel
from gibson2.core.physics.robot_locomotors import *
from gibson2.core.simulator import Simulator
from gibson2.core.physics.scene import *
import gibson2
from gibson2.utils.utils import parse_config, rotate_vector_3d, l2_distance, quatToXYZW
from gibson2.envs.base_env import BaseEnv
from transforms3d.euler import euler2quat
from collections import OrderedDict
from gibson2.envs.locomotor_env import *
import atexit
@fxia22
fxia22 / clean.py
Created August 26, 2018 23:28
clean.py
import os,sys
import numpy as np
fns = []
data_dir = 'data_pose_new'
for fn in os.listdir(data_dir):
fns.append(os.path.join(data_dir, fn))
for fn in fns:
data = np.load(fn)["arr_0"].item()
@fxia22
fxia22 / glinterop.py
Created August 24, 2018 01:05 — forked from sklam/glinterop.py
Numba, PyCUDA, OpenGL interop. Adapted from https://wiki.tiker.net/PyCuda/Examples/GlInterop
# GL interoperability example, by Peter Berrington.
# Draws a rotating teapot, using cuda to invert the RGB value
# each frame
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL.ARB.vertex_buffer_object import *
from OpenGL.GL.ARB.pixel_buffer_object import *
@fxia22
fxia22 / pytorch-glumpy.md
Created August 24, 2018 01:02 — forked from victor-shepardson/pytorch-glumpy.md
using pycuda and glumpy to draw pytorch GPU tensors to the screen without copying to host memory
#!/usr/bin/python
import argparse
import os
import rospy
from std_msgs.msg import Float32, Int64
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Image, CameraInfo
from nav_msgs.msg import Odometry
import rospkg
import numpy as np
@fxia22
fxia22 / process_ukbb.py
Created May 14, 2018 20:01
process_ukbb
import os
import numpy as np
import matplotlib.pyplot as plt
import sys
from tqdm import tqdm
import pandas as pd
main_ukbb_file = sys.argv[1]
other_ukbb_files = sys.argv[1:]
@fxia22
fxia22 / ssa.py
Created December 1, 2017 17:30
ssa
import sys
import numpy as np
from tqdm import tqdm
from scipy.spatial import ConvexHull
filename = sys.argv[1]
vs = []
fs = []