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 | |
import numpy as np | |
import cv2 | |
import time | |
import matplotlib.pyplot as plt | |
def flow2img(flow, BGR=True): | |
x, y = flow[:,:, 0], flow[:,:, 1] |
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 | |
import numpy as np | |
import cv2 | |
import time | |
import matplotlib.pyplot as plt | |
def flow2img(flow, BGR=True): | |
x, y = flow[..., 0], flow[..., 1] | |
hsv = np.zeros((flow.shape[0], flow.shape[1], 3), dtype = np.uint8) |
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
def flow2rgb(flow_map, max_value): | |
global args | |
_, h, w = flow_map.shape | |
flow_map[:,(flow_map[0] == 0) & (flow_map[1] == 0)] = float('nan') | |
rgb_map = np.ones((h,w,3)).astype(np.float32) | |
if max_value is not None: | |
normalized_flow_map = flow_map / max_value | |
else: | |
normalized_flow_map = flow_map / (np.abs(flow_map).max()) | |
rgb_map[:,:,0] += normalized_flow_map[0] |
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 -*- | |
# flake8: noqa | |
from qiniu import Auth, put_file, etag, urlsafe_base64_encode | |
import qiniu.config | |
import fire | |
def upload(imgpath): | |
#需要填写你的 Access Key 和 Secret Key | |
access_key = 'ph4uVrR2rqEPHEKbb-xqQGpLbfgtmYhZN1OnWHgX' |
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/python | |
# -*- coding: utf-8 -*- | |
import MySQLdb | |
def db_execute(data): | |
print(data) | |
for v in data: | |
print v | |
dbs = MySQLdb.connect(host='localhost', user='root', passwd='123456', db='bmonitorcat', port=3306,charset='utf8',init_command="set names utf8") | |
cursor = dbs.cursor() |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> | |
<title></title> | |
<link href="../../css/mui.min.css" rel="stylesheet"/> | |
<link rel="stylesheet" href="../../css/main.css" /> | |
<style> |