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 sys | |
import os.path | |
def detect(filename, cascade_file="./lbpcascade_animeface.xml"): | |
# ファイルがなければエラー | |
if not os.path.isfile(cascade_file): | |
raise RuntimeError("{}: not found".format(cascade_file)) | |
# カスケードのロード |
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
# coding=utf-8 | |
import sys | |
import os.path | |
import datetime | |
import numpy as np | |
import cv2 | |
def export(filename, output="output.m4v"): |
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
# coding=utf-8 | |
import sys | |
import numpy as np | |
import cv2 | |
def split_image(filename): | |
cascade_file="./lbpcascade_animeface.xml" | |
cascade = cv2.CascadeClassifier(cascade_file) | |
if cascade.empty(): |
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
class Store { | |
constructor() { | |
this.obj = {} | |
} | |
get(key) { | |
return this.obj[key] | |
} | |
set(key, val) { | |
this.obj[key] = val | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// @flow | |
import React from 'react'; | |
import styled, {keyframes, css} from 'styled-components'; | |
function transform(percent: number, scale: number = 1) { | |
return css` | |
${percent}% { | |
transform: scale(${scale}); | |
} | |
`; |
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
// @flow | |
import * as I from 'immutable' | |
export function defineRecord<T: Object>( | |
name: string, | |
spec: T | |
): (init: $Shape<T>) => Record<T> { | |
return I.Record(spec, name) | |
} |
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
// @flow | |
import React, { Component } from 'react' | |
import EventListener from 'react-event-listener' | |
import lodash from 'lodash' | |
import catNames from './catNames' | |
import './App.css' | |
type TargetType = string | |
const Target = ({ word, active }: { word: TargetType, active: boolean }) => |
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
// @flow | |
const sum = (a, b) => a + b | |
test('sum', () => { | |
expect(sum(1, 2)).toBe(3) | |
}) | |
const spyLog = jest.spyOn(console, 'log') | |
spyLog.mockImplementation(x => x) |