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
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import shutil | |
| import numpy as np | |
| import cv2 | |
| import pprint | |
| def main(): | |
| img_file1 = sys.argv[1] |
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 os | |
| import sys | |
| import shutil | |
| import cv2 | |
| import numpy as np | |
| def main(): | |
| IMG_DIR = sys.argv[1] | |
| OUT_DIR = sys.argv[2] | |
| height = 1080 |
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
| #!/usr/bin/env python | |
| import sys | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import wave | |
| import scipy.signal as signal | |
| import math | |
| from scipy.interpolate import interp1d | |
| LIMIT_dB = 20 |
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
| #!/usr/bin/env python | |
| import sys | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import wave | |
| import scipy.signal as signal | |
| import math | |
| LIMIT_DB = 20 | |
| MAX_DB = 70 |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| #--- description | |
| # Using WebRTC Voice Activity Detector (VAD) model, | |
| # extract the periods of time a person is speaking | |
| # from the audio file and calculate the percentage. | |
| #--- reference | |
| # https://webrtc.org/ | |
| # https://github.com/wiseman/py-webrtcvad/tree/master |
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 PIL import Image, ImageDraw | |
| height = 300 | |
| width = 600 | |
| txt_x = 2 | |
| txt_y = 2 | |
| txt_color = "red" | |
| def color_save(text, color_rgb): |
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
| #!/usr/bin/env python | |
| from PIL import Image, ImageDraw, ImageFont | |
| import matplotlib.colors as mcolors | |
| import colorsys | |
| import numpy as np | |
| from scipy.spatial import KDTree | |
| height = 200 | |
| width = 400 | |
| txt_x = 2 |
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
| #!/usr/bin/env python | |
| from PIL import Image, ImageDraw, ImageFont | |
| import matplotlib.colors as mcolors | |
| import colorsys | |
| import cv2 | |
| import numpy as np | |
| from scipy.spatial import KDTree | |
| height = 100 | |
| # width = 400 |
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 os | |
| import sys | |
| import cv2 | |
| import numpy as np | |
| from scipy.io import wavfile | |
| def image_to_audio(image_path, output_wav): | |
| img = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) | |
| height, width = img.shape |
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 os | |
| import sys | |
| import cv2 | |
| import numpy as np | |
| from scipy.io import wavfile | |
| import matplotlib.pyplot as plt | |
| def image_to_audio(image_path, output_wav, output_spectrogram): | |
| img = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) |