Skip to content

Instantly share code, notes, and snippets.

View jinyu121's full-sized avatar
💪
Fighting!

Yu Hao jinyu121

💪
Fighting!
View GitHub Profile
@jinyu121
jinyu121 / README.md
Last active November 5, 2017 09:56
V2Ray Self Distribution Point

V2Ray Self Distribution Point

Environment

  • PHP
  • PHP-curl

Useage

  • Download it and put it into any folder
@jinyu121
jinyu121 / parser.py
Last active December 30, 2017 03:29
下载CVPR/ICCV文章、Meta、PDF并导入到Zotero
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from argparse import ArgumentParser
from bs4 import BeautifulSoup
import os
import requests
@jinyu121
jinyu121 / demo_detector.c
Created February 6, 2018 13:01
Darknet Detection PR
void validate_detector_PRcurve(char *datacfg, char *cfgfile, char *weightfile)
{
list *options = read_data_cfg(datacfg);
char *valid_images = option_find_str(options, "valid", "data/voc.2007.test");
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
}
set_batch_network(&net, 1);
@jinyu121
jinyu121 / download_cut_face.py
Created March 8, 2018 08:28
Download and cut comic face
# -*- coding: utf-8 -*-
import time
import redis
import os
import cv2
from threading import Thread
import requests
from tqdm import tqdm
from bs4 import BeautifulSoup
@jinyu121
jinyu121 / CustomTransport.py
Last active March 12, 2018 14:38
Resolve a problem in `wordpress_xmlrpc` package
from xmlrpc.client import Transport, GzipDecodedResponse
class CustomTransport(Transport):
def parse_response(self, response):
# Read response data from httpresponse, and parse it
# Check for new http response object, else it is a file object
if hasattr(response, 'getheader'):
if response.getheader("Content-Encoding", "") == "gzip":
stream = GzipDecodedResponse(response)
@jinyu121
jinyu121 / tmux.sh
Last active April 11, 2018 10:38
Install without sudo
#!/bin/bash
TMUX_VERSION="2.1"
LIBEVENT_VERSION="2.0.20"
NCURSES_VERSION="6.0"
# Set this flag to prevent errors
export CPPFLAGS="-P"
# Script for installing tmux on systems where you don't have root access.
@jinyu121
jinyu121 / vocmnist.py
Created April 11, 2018 12:38
Multi MNIST in VOC format
import torch
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
import numpy as np
import os
from tqdm import tqdm, trange
from skimage.io import imsave
from easydict import EasyDict
from copy import deepcopy
@jinyu121
jinyu121 / ss.py
Created April 15, 2018 11:34
Convert shadowsocks info to ss schema
import base64
server = "12.34.56.78"
port = "12345"
password = "Here is the password"
encrypt_method = "chacha20-ietf-poly1305"
s = "{}:{}".format(encrypt_method, password).encode()
print("ss://{}@{}:{}".format(base64.standard_b64encode(s).decode(), server, port))
@jinyu121
jinyu121 / README.md
Last active April 18, 2018 06:12
TensorFlow 图片分类例子2

TensorFlow 分类例子

数据准备

需要把用到的数据转换成 TfRecord 格式。这里以Flower数据集为例。

网络

这里使用 LeNet5 作为分类网络。

@jinyu121
jinyu121 / README.md
Last active October 5, 2018 10:58
V2Ray backup

Backup a specific binary release version of V2Ray.