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 cv2 | |
import numpy as np | |
from moviepy.editor import VideoFileClip | |
from moviepy.video.io.ffmpeg_writer import FFMPEG_VideoWriter as VideoFileClipWriter | |
lastest_speaker_frames = [None for _ in range(6)] | |
# TODO find a better way to calculate ssim | |
def calculate_ssim(x, y): | |
# Convert images to grayscale |
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
const noop = () => undefined; | |
/** | |
* | |
* @param {string} elementName | |
* @param {string} sourceTagName | |
* @param {object} sourcePrototype | |
* @param {function} setup | |
* @param {function} destroy | |
* @see https://developers.google.com/web/fundamentals/primers/customelements/ | |
*/ |
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
System.set(System.normalizeSync('css'), System.newModule({ | |
fetch() { | |
console.info('disable css loading in test suite'); | |
return Promise.resolve(''); | |
} | |
})); |
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
#install gdal | |
brew install gdal | |
#convert 1:1 | |
ogr2ogr -f "GeoJSON" file.geojson file.shp | |
#convert loose, higher tolerance in simplify reduce files size and lost data precision | |
ogr2ogr -simplify 0.000001 -f "GeoJSON" file.geojson file.shp |
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
public typealias myFunctionDefAlias = (@objc_block (String, String, NSNumber) -> Void) | |
@objc | |
public protocol MyJSExportProtocol: JSExport { | |
// JSExportAs alternative in Swift via closure | |
var myFunction:myFunctionDefAlias? {get} | |
} | |
@objc | |
public class MyJSExportClass: NSObject, MyJSExportProtocol { |