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
""" | |
Usage: python scaled_template_matching_multi.py --template tmp.jpg --image img.jpg | |
Installation: | |
pip install opencv-contrib-python numpy imutils | |
https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_template_matching/py_template_matching.html#template-matching-with-multiple-objects | |
https://stackoverflow.com/questions/49464639/opencv-matchtemplate-threshold-values-for-different-methods | |
""" | |
import glob |
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
""" | |
Usage: python scaled_template_matching.py --template tmp.jpg --image img.jpg | |
Installation: | |
pip install opencv-contrib-python numpy imutils | |
blog post about this scale image & cv2.matchTemplate method: | |
https://www.pyimagesearch.com/2015/01/26/multi-scale-template-matching-using-python-opencv/ | |
""" | |
import glob |
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
{ | |
"python.venvPath": "~/.venvs", | |
"python.linting.pylintEnabled": false, | |
"python.pythonPath": "/Users/cheng/.venvs/offer/bin/python", | |
"python.linting.flake8Enabled": true, | |
"python.linting.enabled": true, | |
"editor.rulers": [80], | |
"html.format.wrapLineLength": 80, |
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
#! /bin/sh | |
# basic package | |
sudo apt-get update | |
sudo apt install -y vim git htop curl wget zsh byobu mysql-server terminator | |
# setup git | |
git config --global user.name cheng10 | |
git config --global user.email cheng10@ualberta.ca | |
git config --global core.editor vim |
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
var PROXY = 'SOCKS5 127.0.0.1:8387;SOCKS 127.0.0.1:8387'; | |
var CHINA_IPv4 = [ | |
['1.12.0.0', '255.252.0.0'], | |
['1.24.0.0', '255.248.0.0'], | |
['1.45.0.0', '255.255.0.0'], | |
['1.48.0.0', '255.252.0.0'], | |
['1.56.0.0', '255.248.0.0'], | |
['1.68.0.0', '255.252.0.0'], | |
['1.80.0.0', '255.240.0.0'], | |
['1.116.0.0', '255.252.0.0'], |
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
1. get default redis.service path | |
[centos@offertest ~]$ sudo systemctl status redis | |
● redis.service - Redis persistent key-value database | |
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled) | |
Drop-In: /etc/systemd/system/redis.service.d | |
└─limit.conf | |
Active: active (running) since Thu 2018-05-03 07:55:48 UTC; 2h 7min ago | |
Main PID: 4990 (redis-server) |
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
# forms.py | |
from django.contrib.auth.models import User | |
from django import forms | |
from django.contrib.admin.widgets import FilteredSelectMultiple | |
class AdvertiserAdminForm(forms.ModelForm): | |
user = forms.ModelMultipleChoiceField( | |
required=False, | |
queryset=User.objects.all(), |