This file contains hidden or 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 | |
| def onehot_dict(input): | |
| onehotd = {k:v for v,k in enumerate(set(input))} | |
| return onehotd | |
| def onehot_encoder(input,onehotd): | |
| dim = len(set(input)) | |
| n = len(input) | |
This file contains hidden or 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 cv2 | |
| import argparse | |
| parser =argparse.ArgumentParser() | |
| parser.add_argument('input_img', help = 'the input image file') | |
| args = parser.parse_args() | |
| def nothing(x): | |
| pass |
This file contains hidden or 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 cv2 | |
| import argparse | |
| # COLORMAP_AUTUMN = 0, | |
| # COLORMAP_BONE = 1, | |
| # X COLORMAP_JET = 2, | |
| # COLORMAP_WINTER = 3, | |
| # X COLORMAP_RAINBOW = 4, | |
| # COLORMAP_OCEAN = 5, | |
| # COLORMAP_SUMMER = 6, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 qgis.core import * | |
| import qgis.utils | |
| def midpair(plist): | |
| '''Iterate over pairs in a list ''' | |
| x=[] | |
| y=[] | |
| for c in plist: | |
| x.append(c[0]) |
This file contains hidden or 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
| #-*- encoding: utf-8 -*- | |
| import MeCab | |
| import sys | |
| import codecs | |
| import argparse | |
| import re, string | |
| parser =argparse.ArgumentParser() | |
| parser.add_argument('input_dict', help = 'the file of input dictionary') |
This file contains hidden or 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
| #-*- encoding: utf-8 -*- | |
| from __future__ import division | |
| import math | |
| import struct | |
| import numpy as np | |
| from multiprocessing import Pool, Value, Array | |
| from sklearn.manifold import TSNE | |
| import matplotlib.pyplot as plt | |
| from matplotlib.font_manager import FontProperties | |
| import scipy |
This file contains hidden or 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
| #encoding: utf-8 | |
| import re | |
| import argparse | |
| import os | |
| parser =argparse.ArgumentParser() | |
| parser.add_argument('input_txt', help = 'the string input') | |
| args = parser.parse_args() | |
NewerOlder