This file contains 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 numpy as np | |
def get_test_mask(): | |
# Create an image | |
r = 100 | |
mask = np.zeros((4 * r, 4 * r), dtype=np.uint8) | |
# Create a sequence of points to make a contour | |
vert = [None] * 6 | |
vert[0] = (3 * r // 2, int(1.34 * r)) |
This file contains 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
// ==UserScript== | |
// @name html_table_auto_sort | |
// @namespace Diyer22 | |
// @description Tempermonkey version of [html-table-sort](https://github.com/jchamet/html-table-sort), and support sorting table in asynchronous content(like gitlab) | |
// @include * | |
// @version 1.7 | |
// @grant none | |
// ==/UserScript== | |
/* |
This file contains 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 boxx import * | |
import numpy as np | |
def zzy(M): | |
# M = np.array([[1,1],[2,2],[3,3]]) | |
a2 = np.sum(M*M, axis = 1).reshape(1,-1) | |
b2 = a2.T | |
ab = M.dot(M.T) |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
code for self-attention | |
see self-attention GAN | |
none-local | |
@author: yl | |
""" |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Download all DIYer22's weekly review and save to one markdown file | |
Created on Mon Jun 25 20:41:22 2018 | |
@author: Lei Yang | |
""" | |
from boxx import * |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Merge multi GIF pictures into one GIF. | |
requirement: | |
pip install boxx>=0.9.1 | |
@author: DIYer22@github | |
""" |
This file contains 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
// ==UserScript== | |
// @name removeZhihuHot | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over your time line! | |
// @author leiYang | |
// @match https://www.zhihu.com | |
// @grant none | |
// ==/UserScript== |
This file contains 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue May 8 20:40:30 2018 | |
@author: yanglei | |
""" | |
''' | |
# Detection Python Environment, Especially distinguish Spyder, Jupyter notebook, Qtconsole |
This file contains 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
helpDoc = ''' | |
Add Page Number to PDF file with Python | |
Python 给 PDF 添加 页码 | |
usage: | |
python addPageNumberToPDF.py [PDF path] | |
require: |
NewerOlder