Skip to content

Instantly share code, notes, and snippets.

View lianyi's full-sized avatar

lianyi lianyi

  • Bethesda MD
View GitHub Profile
@lianyi
lianyi / chat-frontend.js
Created June 15, 2019 21:39 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@lianyi
lianyi / vtk2vtp.py
Created March 4, 2019 17:14 — forked from thomasballinger/vtk2vtp.py
vtk2vtp.py
#!/usr/bin/env python
"""File format conversion
category: vtk, file conversion, tomb"""
import os, sys
import vtk
def vtk2vtp(invtkfile, outvtpfile, binary=False):
"""What it says on the label"""
reader = vtk.vtkPolyDataReader()
@lianyi
lianyi / README-opencv-3.1-raspberry-pi-installation.md
Created February 3, 2019 14:32 — forked from willprice/README-opencv-3.1-raspberry-pi-installation.md
How to install OpenCV 3.1 on Raspbian Jessie (Lite)

Installing OpenCV 3.1 on Raspbian Jessie

Prerequisites

  • Keep your system up to date:
    • $ sudo apt-get update
    • $ sudo apt-get upgrade
    • $ sudo reboot
  • Make sure you've got an internet connection.
  • Make sure you've got
  • wget
@lianyi
lianyi / mongo_import.js
Created September 12, 2018 21:36 — forked from RandomEtc/mongo_import.js
use node.js to copy from one mongo db to another
var url = require('url'),
mongodb = require('mongodb');
var sourceUrl = 'mongodb://user:pass@host:port/db',
targetUrl = 'mongodb://user:pass@host:port/db',
collectionName = 'my_awesome_collection';
function openDbFromUrl(mongoUrl, cb) {
var dbUrl = url.parse(mongoUrl),
dbName = dbUrl.pathname.slice(1), // no slash
#create a test index with shingle mapping
curl -XPUT localhost:9200/test -d '{
"settings":{
"index":{
"analysis":{
"analyzer":{
"analyzer_shingle":{
"tokenizer":"standard",
"filter":["standard", "lowercase", "filter_stop", "filter_shingle"]
}
@lianyi
lianyi / main.py
Last active February 20, 2022 20:17 — forked from khanhnamle1994/main.py
FCN - Full Code
# --------------------------
# Source and reference
# https://github.com/udacity/CarND-Semantic-Segmentation
# https://gist.github.com/lianyi/a5ba8d84f5b68401c2313b05e020b062
# https://medium.com/nanonets/how-to-do-image-segmentation-using-deep-learning-c673cc5862ef
# --------------------------
# --------------------------
# DATA PREPARATION
@lianyi
lianyi / readme.md
Created January 10, 2018 17:30 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@lianyi
lianyi / classifier_from_little_data_script_3.py
Created January 10, 2018 17:27 — forked from fchollet/classifier_from_little_data_script_3.py
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@lianyi
lianyi / README.md
Created February 16, 2017 15:25 — forked from mbostock/.block
Spline Editor

Click to add new points. Hit the DELETE key to remove the selected point. Use the dropdown menu to change the interpolation mode.

@lianyi
lianyi / .block
Created February 16, 2017 15:23 — forked from mbostock/.block
Line Interpolation
license: gpl-3.0