12/25/2020
12/23/2020
delete over than specific megabyte in git history using bfg
firstly, install bfg
on mac
> brew install bfg
delete object if over than 50m in git commit history
> bfg --strip-blobs-bigger-than 50M
make sure & apply .gitignore
First, to check what files are you actually tracking
> git ls-tree --name-only --full-tree -r HEAD
Let say that you found unwanted files in a directory like cache/ so, it's safer to target that directory instead of all of your files.
So instead of:
> git rm -r --cached .
It's safer to target the unwanted file or directory:
> git rm -r --cached cache/
Then proceed to add all changes:
> git add .
and commit
> git commit -m ".gitignore is now working"
list up and sorting file(object) size in git / command
use following cmd:
> git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | sed -n 's/^blob //p' | sort --numeric-sort --key=2 | cut -c 1-12,41- | $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
12/22/2020
get YouTube video url from channel name, python youtube-dl library
install youtube-dl package first.
pip install YouTube-dl
<code>
import subprocess
direct_output = subprocess.check_output('youtube-dl --get-id https://www.youtube.com/channel/UCAwWYtU_DEdRFxEHl9879dRYBfQ/videos --no-check-certificate', shell=True)
Lines = direct_output.decode()
idv = Lines.split('\n')
play_url_list = []
for idv in Lines.split('\n'):
if idv == '':
continue
print(idv)
play_url_list.append( 'https://www.youtube.com/watch?v={}'.format(idv) )
</code>
Thank you.
Download or streaming YouTube video through cv2, python sample code
firstly, install pafy python package
> pip install pafyif you some this related error "youtube_dl", install this. pafy works based on this package.
> pip install youtube-dl
you can check youtube-dl version:
> youtube-dl --version
if you also have some certification error, you can use --no-check-certification option
try this and test, this command will download video.
> sudo youtube-dl --no-check-certificate https://www.youtube.com/watch?v=N8A-BxTfTaY
ok then everything will be work using following code:
import pafy
from matplotlib import pyplot as plt
import cv2
url = "https://www.youtube.com/watch?v=TKbNDqcgjzw"
video = pafy.new(url, ydl_opts={'nocheckcertificate': True})
best = video.getbest(preftype="mp4")
cap = cv2.VideoCapture()
cap.open(best.url)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Display the resulting frame
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
Thank you.
12/21/2020
python notebook clear output
from IPython.display import clear_output
for i in range(10):
clear_output(wait=True)
print("Hello World!")
Subscribe to:
Posts (Atom)
-
make well divided linear coordinate And make pair coordinate Please see code for detail explanation. import numpy as np import cv2 ...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
This post is about how to copy Mat data to vector and copy vector data to Mat. Reference this example source code. printf("///////...
-
This is dithering example, it make image like a stippling effect. I referenced to blew website. wiki page: https://en.wikipedia.org/wik...
-
In past, I wrote an articel about YUV 444, 422, 411 introduction and yuv <-> rgb converting example code. refer to this page -> ht...
-
* Introduction - The solution shows panorama image from multi images. The panorama images is processing by real-time stitching algorithm...
-
opencv lecture 4-1 example code < gist start > < gist end >
-
As you can see in the following video, I created a class that stitching n cameras in real time. https://www.youtube.com/user/feelmare/sear...
-
Created Date : 2011.8 Language : Matlab Tool : Matlab 2010 Library & Utilized : - Reference : Multiple View Geometry (Hartly and Z...
-
Background subtractor example souce code. OpenCV support about 3 types subtraction algorithm. Those are MOG, MOG2, GMG algorithms. Det...
