- https://www.biranchi.com
View async_await.py
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 asyncio import run | |
async def sum(): | |
total = 0 | |
for i in range(0,10): | |
print(f'i : {i}') | |
total += i | |
return total |
View download.py
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 requests | |
url = 'https://www.facebook.com/favicon.ico' | |
r = requests.get(url, allow_redirects=True) | |
with open('facebook.ico', 'wb') as f: | |
f.write(r.content) |
View bigram_tokens.py
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 nltk | |
nltk.download('punkt') | |
import itertools | |
text = "today is 'Nayan's birthday. she loves ice cream. she is also fond of cream cake. we will celebrate her birthday with ice cream cake" | |
sentences = nltk.sent_tokenize(text) | |
words = [nltk.word_tokenize(sent) for sent in sentences] | |
print(words) |
View Tensorflow Object Detection API
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
Tensorflow Object Detection API : | |
================================== | |
https://www.youtube.com/watch?v=COlbP62-B-U&index=1&list=PLQVvvaa0QuDcNK5GeCQnxYnSSaar2tpku | |
https://github.com/tensorflow/models/tree/master/research/object_detection | |
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md | |
View LabelImg.txt
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
Steps for Installing LabelImg : | |
================================= | |
Step 1. | |
git clone https://github.com/tzutalin/labelImg | |
Step 2. | |
sudo pip3 install pyqt5 lxml | |
Step 3. |
View FaceLandmarkDetection.py
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 imutils import face_utils | |
import dlib | |
import cv2 | |
import time | |
# initialize dlib's face detector (HOG-based) and then create | |
# the facial landmark predictor | |
cap = cv2.VideoCapture(0) |
View delete_all_tweets.py
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 -*- | |
""" | |
This script will delete all of the tweets in the specified account. | |
You may need to hit the "more" button on the bottom of your twitter profile | |
page every now and then as the script runs, this is due to a bug in twitter. | |
You will need to get a consumer key and consumer secret token to use this | |
script, you can do so by registering a twitter application at https://dev.twitter.com/apps | |
@requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1) |
View opencv_show_webcam_detect_face.py
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 python2 | |
""" | |
OpenCV example. Show webcam image and detect face. | |
""" | |
import cv2 | |
TRAINSET = "/usr/share/OpenCV/lbpcascades/lbpcascade_frontalface.xml" | |
DOWNSCALE = 4 |
View camera.py
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 | |
# Windows dependencies | |
# - Python 2.7.6: http://www.python.org/download/ | |
# - OpenCV: http://opencv.org/ | |
# - Numpy -- get numpy from here because the official builds don't support x64: | |
# http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy | |
# Mac Dependencies | |
# - brew install python |
View luhn.js
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
/** | |
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers | |
* @author ShirtlessKirk. Copyright (c) 2012. | |
* @license WTFPL (http://www.wtfpl.net/txt/copying) | |
*/ | |
var luhnChk = (function (arr) { | |
return function (ccNum) { | |
var | |
len = ccNum.length, | |
bit = 1, |
NewerOlder