Skip to content

Instantly share code, notes, and snippets.

View lyyiangang's full-sized avatar

biangbiangmian lyyiangang

  • ShangHai.China
View GitHub Profile
@caolingyu
caolingyu / cursor-reset.py
Created February 7, 2025 06:55
Cursor Reset
import json
import os
import shutil
import uuid
from datetime import datetime
from pathlib import Path
import platform
def backup_file(file_path: str):
@ikuokuo
ikuokuo / onnx_cut.py
Created June 2, 2021 13:21
Cut sub-model from an ONNX model, and update its input/output names or shapes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import argparse
import os
import sys
import timeit
import typing
import onnx
@jinyu121
jinyu121 / README.md
Last active July 18, 2023 07:09
SimpleImageHTTPServer

SimpleImageHTTPServer

Modified from SimpleHTTPServer, this file can setup a simple image server, to view folder, image, and compare images between folders.

How to use

Start

python image_server.py --path path/to/your/image/folder
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active March 22, 2026 18:51
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@smeschke
smeschke / smooth_pose_data.py
Last active March 17, 2025 14:56
Smooth Pose Estimation Data
import pandas as pd
import numpy as np
import cv2, os
import scipy
from scipy import signal
import csv
circle_color, line_color = (255,255,0), (0,0,255)
window_length, polyorder = 13, 2
sd = "workout"
@jinyu121
jinyu121 / coco_to_voc.py
Last active April 27, 2023 02:26
Convert COCO to VOC
import json
import os
from tqdm import tqdm
from xmltodict import unparse
# BBOX_OFFSET: Switch between 0-based and 1-based bbox.
# The COCO dataset is in 0-based format, while the VOC dataset is 1-based.
# To keep 0-based, set it to 0. To convert to 1-based, set it to 1.
BBOX_OFFSET = 0
@jingmian
jingmian / ShadowSocks.sh
Last active January 9, 2023 05:27
Ubuntu下安装ShadowSocks客户端
sudo apt-get update
sudo apt-get install python-pip
sudo apt-get install python-setuptools m2crypto
pip install shadowsocks
如果是ubuntu16.04 直接 (16.04 里可以直接用apt 而不用 apt-get 这是一项改进)
sudo apt install shadowsocks
nohup sslocal -c /opt/trainee/shadowsocks.json &
@kdubovikov
kdubovikov / tensorflow_mnist.py
Created June 18, 2017 07:29
TensorFlow MNIST example
import numpy as np
import tensorflow as tf
from tensorflow.contrib import learn
from tensorflow.contrib.learn.python.learn.estimators import model_fn as model_fn_lib
tf.logging.set_verbosity(tf.logging.INFO)
def cnn_model_fn(features, labels, mode):
@christian-rauch
christian-rauch / class_weights.py
Last active July 5, 2023 14:06
class weights by median frequency balancing
#!/usr/bin/env python
import sys, os
import glob
import numpy as np
import skimage.io as io
np.set_printoptions(precision=15)
files = glob.glob(os.path.join(sys.argv[1], "*.png"))
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active January 24, 2026 19:55
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS