commit ddc91bf4e2de5cb019d98fcbc3d10e336a6b006e Author: 编码猿 Date: Fri Sep 27 01:20:28 2024 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..403adbc --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules +/dist + + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.pydio b/.pydio new file mode 100644 index 0000000..77820bb --- /dev/null +++ b/.pydio @@ -0,0 +1 @@ +4c2a7b05-272a-403e-aae0-746945f22548 \ No newline at end of file diff --git a/FaceUnlock.icns b/FaceUnlock.icns new file mode 100755 index 0000000..21def0c Binary files /dev/null and b/FaceUnlock.icns differ diff --git a/__main__.py b/__main__.py new file mode 100755 index 0000000..be932a2 --- /dev/null +++ b/__main__.py @@ -0,0 +1,9 @@ +import numpy.core.multiarray +from app import Application + +def start(): + Application().run() + +if __name__ == "__main__": + start() + diff --git a/app/.pydio b/app/.pydio new file mode 100644 index 0000000..b7e78cc --- /dev/null +++ b/app/.pydio @@ -0,0 +1 @@ +d1ce8940-3c26-4908-a8e0-6e67719d4585 \ No newline at end of file diff --git a/app/__init__.py b/app/__init__.py new file mode 100755 index 0000000..5f8439d --- /dev/null +++ b/app/__init__.py @@ -0,0 +1,131 @@ +import multiprocessing +import cv2 as cv +from multiprocessing import Process, Queue +from app.lib.face.facepp import API, File +from app.util.system_api import ge_device_info, lock_screen, unlock, sudo +from app.config import Config +from os import path, remove + +class Application: + + def __init__(self): + + # 保存当前锁屏状态 + Config.is_locked = ge_device_info().get('CGSSessionScreenIsLocked', False) + + def run(self): + try: + + mydict = multiprocessing.Manager().dict() + mydict['get_pic'] = 'true' + + frame = Queue() + + # 启动摄像头 + camera_frame = Process( + target=self.OpenCamera, + args=("摄像头", frame, mydict) + ) + + + # 实时图片处理 + img_frame = Process( + target=self.ProcessingPictures, + args=("处理图片", frame, mydict) + ) + + camera_frame.start() + img_frame.start() + + camera_frame.join() + img_frame.join() + + except KeyboardInterrupt: + print("任务被终止了") + + + # 打开摄像头捕捉图片 + def OpenCamera(self, task_name, queue, mydict): + + # 初始化状态,不进行图像传输 + mydict["get_pic"] = "true" + + capture = cv.VideoCapture(0) + print(task_name + "任务启动..") + + try: + while True: + # 一帧一帧读取视频 + ret, frame = capture.read() + if mydict["get_pic"] == "true": + mydict["get_pic"] = "false" + queue.put(frame) + + # cv.imshow('capture', frame) + # cv.namedWindow("摄像头", 0) + # cv.resizeWindow("capture", 0, 0) + # cv.imshow('capture', frame) + cv.waitKey(1) + + except KeyboardInterrupt: + capture.release() + print(task_name + "任务关闭...") + + # 处理图片,face++人脸对比 + def ProcessingPictures(self, task_name, queue, mydict): + print(task_name + "任务启动") + try: + while True: + + # 从队列中获取图片,显示图像质量 + mydict["get_pic"] = "true" + + frame = queue.get() + + cv.imwrite(self.PicPath("current_user.jpg"), frame) + + compare_res = Config.faceApi.compare( + image_file1=File(self.PicPath("administrators.jpg")), + image_file2=File(self.PicPath("current_user.jpg")) + ) + + if ('confidence' in compare_res): + print("捕捉的摄像头人物相似度:", compare_res['confidence']) + # 如果是锁屏状态 + if Config.is_locked: + # 如果是管理员 + if compare_res['confidence'] > 50.0: + print("锁屏状态下,是管理员,所以需要进行解锁....") + Config.is_locked = False + # sudo("say '欢迎,正在自动解锁中!'") + unlock() + else: + sudo("say '不是管理员,无法解锁!'") + else: + if compare_res['confidence'] > 50.0: + print("非锁屏状态下,是管理员,无需操作....") + else: + sudo("say '不是管理员,即将锁屏!'") + Config.is_locked = True + lock_screen() + + + # 摄像头前没有检测到人的时候,进行锁屏 + else: + if Config.is_first_count == 1: + print("是第一次运行,什么都不操作") + Config.is_first_count+=1 + else: + print("不是第一次运行,屏幕前还没有人,进行锁屏") + # remove(self.PicPath("current_user.jpg")) + Config.is_locked = True + lock_screen() + + except KeyboardInterrupt: + # remove(self.PicPath("current_user.jpg")) + print(task_name + "任务被终止") + + + def PicPath(self, fileName): + parent = path.abspath(path.dirname(path.realpath(__file__)) + path.sep + 'res/img/'+fileName); + return parent \ No newline at end of file diff --git a/app/config/.pydio b/app/config/.pydio new file mode 100644 index 0000000..c0e4364 --- /dev/null +++ b/app/config/.pydio @@ -0,0 +1 @@ +dfe42562-cb6b-402e-82ac-fb51d7405e86 \ No newline at end of file diff --git a/app/config/__init__.py b/app/config/__init__.py new file mode 100755 index 0000000..2cb8f33 --- /dev/null +++ b/app/config/__init__.py @@ -0,0 +1,35 @@ +from app.lib.face.facepp import API, File + +class Config: + # 管理员头像地址,需要替换成你自己的头像 + administrators = "./res/img/administrators.jpg" + + # 摄像头实时捕获的截图存放地址 + current_user = "./res/img/current_user.jpg" + + # face++ api 初始化 + faceApi = API() + + # 是否处于锁屏状态,False 解锁状态下,True 锁屏状态下 + is_locked = False + + # 电脑锁屏密码 + password = "" + + # 是否是第一次运行,False 是 不锁屏,true 不是 进行锁屏 + is_first_count = 1 + + # pyobjc-framework-Quartz 获取到的状态 + cg_session_info = None + + author = 'bmy' + app_name = 'FaceUnlock' + app_env = '%s_ENV' % app_name.upper() + version = '1.3.3' + github_page = 'https://github.com/%s/%s' % (author, app_name) + releases_url = '%s/releases' % github_page + protector = '[protector]' + idle_time = 30 + idle_time_short = 2 + unlock_count_limit = 3 + restart_deadline = 0.2 \ No newline at end of file diff --git a/app/config/__pycache__/.pydio b/app/config/__pycache__/.pydio new file mode 100644 index 0000000..d4eae7d --- /dev/null +++ b/app/config/__pycache__/.pydio @@ -0,0 +1 @@ +b58309fb-3b74-40b9-85b4-556969e2a95e \ No newline at end of file diff --git a/app/config/__pycache__/__init__.cpython-311.pyc b/app/config/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..4c26c3f Binary files /dev/null and b/app/config/__pycache__/__init__.cpython-311.pyc differ diff --git a/app/config/__pycache__/__init__.cpython-38.pyc b/app/config/__pycache__/__init__.cpython-38.pyc new file mode 100755 index 0000000..a7b2fa2 Binary files /dev/null and b/app/config/__pycache__/__init__.cpython-38.pyc differ diff --git a/app/config/__pycache__/__init__.cpython-39.pyc b/app/config/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 0000000..104c2a5 Binary files /dev/null and b/app/config/__pycache__/__init__.cpython-39.pyc differ diff --git a/app/lib/.pydio b/app/lib/.pydio new file mode 100644 index 0000000..32c03b4 --- /dev/null +++ b/app/lib/.pydio @@ -0,0 +1 @@ +477a6769-a4e6-472a-8363-e0c226835938 \ No newline at end of file diff --git a/app/lib/__init__.py b/app/lib/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/app/lib/__pycache__/.pydio b/app/lib/__pycache__/.pydio new file mode 100644 index 0000000..9942339 --- /dev/null +++ b/app/lib/__pycache__/.pydio @@ -0,0 +1 @@ +73b7d0b2-a0f6-4894-8971-b4650a01063f \ No newline at end of file diff --git a/app/lib/__pycache__/__init__.cpython-311.pyc b/app/lib/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..1b17f70 Binary files /dev/null and b/app/lib/__pycache__/__init__.cpython-311.pyc differ diff --git a/app/lib/__pycache__/__init__.cpython-38.pyc b/app/lib/__pycache__/__init__.cpython-38.pyc new file mode 100755 index 0000000..65fd2b8 Binary files /dev/null and b/app/lib/__pycache__/__init__.cpython-38.pyc differ diff --git a/app/lib/__pycache__/__init__.cpython-39.pyc b/app/lib/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 0000000..e1400e1 Binary files /dev/null and b/app/lib/__pycache__/__init__.cpython-39.pyc differ diff --git a/app/lib/face/.pydio b/app/lib/face/.pydio new file mode 100644 index 0000000..a686c36 --- /dev/null +++ b/app/lib/face/.pydio @@ -0,0 +1 @@ +af6921d2-187d-4cc8-b5eb-2db957efd2f6 \ No newline at end of file diff --git a/app/lib/face/ImagePro.py b/app/lib/face/ImagePro.py new file mode 100755 index 0000000..7b5c4b2 --- /dev/null +++ b/app/lib/face/ImagePro.py @@ -0,0 +1,125 @@ +import base64 +import io +import os +from PIL import Image, ImageColor + + +class ImageProCls: + base64FilePath=None + + @staticmethod + def humanbody_blending_with_image(input_image, gray_image, bg_image): + """ + + :param input_image: the PIL.Image instance, the source humanbody image + :param gray_image: the PIL.Image instance, it is created from api base64 result, a gray image + :param bg_image: the PIL.Image instance, the background image you want to replace + :return: the PIL.Image instance is blending with humanbody + + notes: you should close the return object after you leave + """ + input_width, input_height = input_image.size + bg_width, bg_height = bg_image.size + + input_aspect_ratio = input_width / float(input_height) + bg_aspect_ratio = bg_width / float(bg_height) + + if bg_aspect_ratio > input_aspect_ratio: + target_width, target_height = int(bg_height * input_aspect_ratio), bg_height + else: + target_width, target_height = bg_width, int(bg_width / input_aspect_ratio) + + crop_image = bg_image.crop((0, 0, 0+target_width, 0+target_height)) + new_image = crop_image.resize((input_width, input_height)) + crop_image.close() + + for x in range(0, input_width): + for y in range(0, input_height): + coord = (x, y) + gray_pixel_value = gray_image.getpixel(coord) + input_rgb_color = input_image.getpixel(coord) + bg_rgb_color = new_image.getpixel(coord) + + confidence = gray_pixel_value / 255.0 + alpha = confidence + + R = input_rgb_color[0] * alpha + bg_rgb_color[0] * (1 - alpha) + G = input_rgb_color[1] * alpha + bg_rgb_color[1] * (1 - alpha) + B = input_rgb_color[2] * alpha + bg_rgb_color[2] * (1 - alpha) + + R = max(0, min(int(R), 255)) + G = max(0, min(int(G), 255)) + B = max(0, min(int(B), 255)) + + new_image.putpixel(coord, (R, G, B)) + + return new_image + + @staticmethod + def humanbody_blending_with_color(input_image, gray_image, bg_color): + """ + :param input_image: the PIL.Image instance + :param gray_image: the PIL.Image instance, it is created from api base64 result, it is a gray image + :param bg_color: a color string value, such as '#FFFFFF' + :return: PIL.Image instance + + notes: you should close the return object after you leave + """ + input_width, input_height = input_image.size + bg_rgb_color = ImageColor.getrgb(bg_color) + + new_image = Image.new("RGB", input_image.size, bg_color) + + for x in range(0, input_width): + for y in range(0, input_height): + coord = (x, y) + gray_pixel_value = gray_image.getpixel(coord) + input_rgb_color = input_image.getpixel(coord) + + confidence = gray_pixel_value / 255.0 + alpha = confidence + + R = input_rgb_color[0] * alpha + bg_rgb_color[0] * (1 - alpha) + G = input_rgb_color[1] * alpha + bg_rgb_color[1] * (1 - alpha) + B = input_rgb_color[2] * alpha + bg_rgb_color[2] * (1 - alpha) + + R = max(0, min(int(R), 255)) + G = max(0, min(int(G), 255)) + B = max(0, min(int(B), 255)) + + new_image.putpixel(coord, (R, G, B)) + + return new_image + + @staticmethod + def getSegmentImg(filePath): + input_file = '' + with open(filePath, 'r') as f: + input_file = f.read() + input_file = base64.b64decode(input_file) + + gray_image = Image.open(io.BytesIO(input_file)) + input_image = Image.open('./imgResource/segment.jpg', 'r') + + new_image = ImageProCls.humanbody_blending_with_color(input_image, gray_image, '#FFFFFF') + new_image.save('./imgResource/resultImg.jpg') + print('-' * 60) + print('结果已经生成,生成文件名:resultImg.jpg,请在imgResource/目录下查看') + if os.path.exists(filePath): + os.remove(filePath) + f.close() + new_image.close() + input_image.close() + gray_image.close() + + @staticmethod + def getMergeImg(base64Str): + imgdata = base64.b64decode(base64Str) + file = open('./imgResource/MergeResultImg.jpg', 'wb') + file.write(imgdata) + file.close() + print('结果已经生成,生成文件名:MergeResultImg.jpg,请在imgResource/目录下查看') + + + + diff --git a/app/lib/face/__init__.py b/app/lib/face/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/app/lib/face/__pycache__/.pydio b/app/lib/face/__pycache__/.pydio new file mode 100644 index 0000000..abb4bd1 --- /dev/null +++ b/app/lib/face/__pycache__/.pydio @@ -0,0 +1 @@ +2cd2cff3-ad8d-41e2-a0a8-ef9e540f2339 \ No newline at end of file diff --git a/app/lib/face/__pycache__/__init__.cpython-311.pyc b/app/lib/face/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..d5468bc Binary files /dev/null and b/app/lib/face/__pycache__/__init__.cpython-311.pyc differ diff --git a/app/lib/face/__pycache__/__init__.cpython-38.pyc b/app/lib/face/__pycache__/__init__.cpython-38.pyc new file mode 100755 index 0000000..cfb7d9f Binary files /dev/null and b/app/lib/face/__pycache__/__init__.cpython-38.pyc differ diff --git a/app/lib/face/__pycache__/__init__.cpython-39.pyc b/app/lib/face/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 0000000..3abe90b Binary files /dev/null and b/app/lib/face/__pycache__/__init__.cpython-39.pyc differ diff --git a/app/lib/face/__pycache__/compat.cpython-311.pyc b/app/lib/face/__pycache__/compat.cpython-311.pyc new file mode 100644 index 0000000..3421034 Binary files /dev/null and b/app/lib/face/__pycache__/compat.cpython-311.pyc differ diff --git a/app/lib/face/__pycache__/compat.cpython-38.pyc b/app/lib/face/__pycache__/compat.cpython-38.pyc new file mode 100755 index 0000000..9d48665 Binary files /dev/null and b/app/lib/face/__pycache__/compat.cpython-38.pyc differ diff --git a/app/lib/face/__pycache__/compat.cpython-39.pyc b/app/lib/face/__pycache__/compat.cpython-39.pyc new file mode 100755 index 0000000..3ff850a Binary files /dev/null and b/app/lib/face/__pycache__/compat.cpython-39.pyc differ diff --git a/app/lib/face/__pycache__/facepp.cpython-311.pyc b/app/lib/face/__pycache__/facepp.cpython-311.pyc new file mode 100644 index 0000000..2fce77e Binary files /dev/null and b/app/lib/face/__pycache__/facepp.cpython-311.pyc differ diff --git a/app/lib/face/__pycache__/facepp.cpython-38.pyc b/app/lib/face/__pycache__/facepp.cpython-38.pyc new file mode 100755 index 0000000..aa4665d Binary files /dev/null and b/app/lib/face/__pycache__/facepp.cpython-38.pyc differ diff --git a/app/lib/face/__pycache__/facepp.cpython-39.pyc b/app/lib/face/__pycache__/facepp.cpython-39.pyc new file mode 100755 index 0000000..ad2e2a3 Binary files /dev/null and b/app/lib/face/__pycache__/facepp.cpython-39.pyc differ diff --git a/app/lib/face/__pycache__/structures.cpython-311.pyc b/app/lib/face/__pycache__/structures.cpython-311.pyc new file mode 100644 index 0000000..e32eb0f Binary files /dev/null and b/app/lib/face/__pycache__/structures.cpython-311.pyc differ diff --git a/app/lib/face/__pycache__/structures.cpython-38.pyc b/app/lib/face/__pycache__/structures.cpython-38.pyc new file mode 100755 index 0000000..0600436 Binary files /dev/null and b/app/lib/face/__pycache__/structures.cpython-38.pyc differ diff --git a/app/lib/face/__pycache__/structures.cpython-39.pyc b/app/lib/face/__pycache__/structures.cpython-39.pyc new file mode 100755 index 0000000..6a19fa4 Binary files /dev/null and b/app/lib/face/__pycache__/structures.cpython-39.pyc differ diff --git a/app/lib/face/compat.py b/app/lib/face/compat.py new file mode 100755 index 0000000..0b24059 --- /dev/null +++ b/app/lib/face/compat.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- + +""" +This module handles import compatibility issues between Python 2 and +Python 3. +""" + +import sys +import random +import string + +# ------- +# Pythons +# ------- + +# Syntax sugar. +_ver = sys.version_info + +#: Python 2.x? +is_py2 = (_ver[0] == 2) + +#: Python 3.x? +is_py3 = (_ver[0] == 3) + +try: + import simplejson as json +except ImportError: + import json + +# --------- +# Specifics +# --------- + +if is_py2: + from urllib2 import Request, urlopen, HTTPError, URLError + builtin_str = str + bytes = str + str = unicode + basestring = basestring + numeric_types = (int, long, float) + integer_types = (int, long) + +elif is_py3: + from urllib.request import Request, urlopen + from urllib.error import HTTPError, URLError + builtin_str = str + str = str + bytes = bytes + basestring = (str, bytes) + numeric_types = (int, float) + integer_types = (int,) + + +def enc(x): + if isinstance(x, str): + return x.encode('utf-8') + elif isinstance(x, numeric_types): + return str(x).encode('utf-8') + return x + + +def choose_boundary(): + rand_letters = ''.join(random.sample(string.ascii_letters+string.digits, 15)) + return '{ch}{flag}{rand}'.format(ch='-'*6, flag='PylibFormBoundary', rand=rand_letters) diff --git a/app/lib/face/facepp.py b/app/lib/face/facepp.py new file mode 100755 index 0000000..01fbbd7 --- /dev/null +++ b/app/lib/face/facepp.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- + +"""a simple facepp sdk +usage: + api = API(key, secret) + api.detect(img = File('/tmp/test.jpg')) +""" + +import sys +import socket +import json +import os.path +import itertools +import mimetypes +import time +from collections.abc import Iterable +from app.lib.face.structures import ObjectDict +from app.lib.face.compat import (basestring, str, numeric_types, enc, choose_boundary, + Request, urlopen, HTTPError, URLError) + +import ssl +ssl._create_default_https_context = ssl._create_unverified_context + +__all__ = ['File', 'APIError', 'API'] + +DEBUG_LEVEL = 1 + +# 添加API Key API Secret +API_KEY = "xfXREfL_pXgnqK2GedOunNPN2MFYSsPR" +API_SECRET = "x0PGyvHoVSjX19KlkjH1Ct7Md5wxz8aV" + + +class File(object): + + """an object representing a local file""" + path = None + content = None + + def __init__(self, path): + self.path = path + self._get_content() + + def _get_content(self): + """read image content""" + + if os.path.getsize(self.path) > 2 * 1024 * 1024: + raise APIError(-1, None, 'image file size too large') + else: + with open(self.path, 'rb') as f: + self.content = f.read() + + def get_filename(self): + return os.path.basename(self.path) + + +class APIError(Exception): + code = None + """HTTP status code""" + + url = None + """request URL""" + + body = None + """server response body; or detailed error information""" + + def __init__(self, code, url, body): + self.code = code + self.url = url + self.body = body + + def __str__(self): + return 'code={s.code}\nurl={s.url}\n{s.body}'.format(s=self) + + __repr__ = __str__ + + +class API(object): + key = None + secret = None + server = 'https://api-cn.faceplusplus.com' + + decode_result = True + timeout = None + max_retries = None + retry_delay = None + + def __init__(self): + """ + :param srv: The API server address + :param decode_result: whether to json_decode the result + :param timeout: HTTP request timeout in seconds + :param max_retries: maximal number of retries after catching URL error + or socket error + :param retry_delay: time to sleep before retrying + """ + if len(API_KEY)==0 or len(API_SECRET)==0: + print('\n'+'请在'+os.path.realpath(__file__)+'文件中填写正确的API_KEY和API_SECRET'+'\n') + exit(1) + + self.key = API_KEY + self.secret = API_SECRET + + srv = None + decode_result = True + timeout = 30 + max_retries = 10 + retry_delay = 5 + if srv: + self.server = srv + self.decode_result = decode_result + assert timeout >= 0 or timeout is None + assert max_retries >= 0 + self.timeout = timeout + self.max_retries = max_retries + self.retry_delay = retry_delay + + _setup_apiobj(self, self, '', []) + + def update_request(self, request): + """overwrite this function to update the request before sending it to + server""" + pass + + +def _setup_apiobj(self, api, prefix, path): + if self is not api: + self._api = api + self._urlbase = '{server}/{prefix}/{path}'.format(server=api.server, prefix=prefix, path='/'.join(path)) + + lvl = len(path) + done = set() + for prefix, paths in _APIS: + for i in paths: + if len(i) <= lvl: + continue + cur = i[lvl] + if i[:lvl] == path and cur not in done: + done.add(cur) + setattr(self, cur, _APIProxy(api, prefix, i[:lvl + 1])) + + +class _APIProxy(object): + _api = None + """underlying :class:`API` object""" + + _urlbase = None + + def __init__(self, api, prefix, path): + _setup_apiobj(self, api, prefix, path) + + def __call__(self, *args, **kargs): + if len(args): + raise TypeError('Only keyword arguments are allowed') + form = _MultiPartForm() + + for (k, v) in kargs.items(): + if isinstance(v, File): + form.add_file(k, v.get_filename(), v.content) + + url = self._urlbase + for k, v in self._mkarg(kargs).items(): + form.add_field(k, v) + + body = form.bytes + request = Request(url, data=body) + request.add_header('Content-type', form.get_content_type()) + request.add_header('Content-length', str(len(body))) + + self._api.update_request(request) + + retry = self._api.max_retries + while True: + retry -= 1 + try: + ret = urlopen(request, timeout=self._api.timeout).read() + break + except HTTPError as e: + raise APIError(e.code, url, e.read()) + except (socket.error, URLError) as e: + if retry < 0: + raise e + _print_debug('caught error: {}; retrying'.format(e)) + time.sleep(self._api.retry_delay) + + if self._api.decode_result: + try: + ret = json.loads(ret, object_hook=ObjectDict) + except: + raise APIError(-1, url, 'json decode error, value={0!r}'.format(ret)) + return ret + + def _mkarg(self, kargs): + """change the argument list (encode value, add api key/secret) + :return: the new argument list""" + + kargs = kargs.copy() + kargs['api_key'] = self._api.key + kargs['api_secret'] = self._api.secret + for k, v in list(kargs.items()): + if isinstance(v, Iterable) and not isinstance(v, basestring): + kargs[k] = ','.join(v) + elif isinstance(v, File) or v is None: + del kargs[k] + elif isinstance(v, numeric_types): + kargs[k] = str(v) + else: + kargs[k] = v + + return kargs + + +class _MultiPartForm(object): + + """Accumulate the data to be used when posting a form.""" + + def __init__(self): + self.form_fields = [] + self.files = [] + self.boundary = choose_boundary() + + def get_content_type(self): + return 'multipart/form-data; boundary={}'.format(self.boundary) + + def add_field(self, name, value): + """Add a simple field to the form data.""" + self.form_fields.append((name, value)) + + def add_file(self, fieldname, filename, content, mimetype=None): + """Add a file to be uploaded.""" + if mimetype is None: + mimetype = mimetypes.guess_type(filename)[0] or 'application/octet-stream' + self.files.append((fieldname, filename, mimetype, content)) + + @property + def bytes(self): + """Return a string(2.x) or bytes(3.x) representing the form data, including attached files.""" + # Build a list of lists, each containing "lines" of the + # request. Each part is separated by a boundary string. + # Once the list is built, return a string where each + # line is separated by '\r\n'. + parts = [] + part_boundary = "--" + self.boundary + + # Add the form fields + parts.extend( + [part_boundary, + 'Content-Disposition: form-data; name="{}"'.format(name), '', value] + for name, value in self.form_fields + ) + + # Add the files to upload + parts.extend( + [part_boundary, + 'Content-Disposition: form-data; name="{}"; filename="{}"'.format(field_name, filename), + 'Content-Type: {}'.format(content_type), + '', + body, + ] + for field_name, filename, content_type, body in self.files + ) + + # Flatten the list and add closing boundary marker, + # then return CR+LF separated data + flattened = list(itertools.chain(*parts)) + flattened.append(part_boundary + '--') + flattened.append('') + return b'\r\n'.join(enc(x) for x in flattened) + + +def _print_debug(msg): + if DEBUG_LEVEL: + sys.stderr.write(str(msg) + '\n') + + +_APIS = [ + { + 'prefix': 'facepp/v3', + 'paths': [ + '/detect', + '/compare', + '/search', + '/faceset/create', + '/faceset/addface', + '/faceset/removeface', + '/faceset/update', + '/faceset/getdetail', + '/faceset/delete', + '/faceset/getfacesets', + '/face/analyze', + '/face/getdetail', + '/face/setuserid', + ], + }, + { + 'prefix': 'humanbodypp/v1', + 'paths': [ + '/detect', + '/segment', + ] + }, + { + 'prefix': 'cardpp/v1', + 'paths': [ + '/ocridcard', + '/ocrdriverlicense', + '/ocrvehiclelicense', + '/ocrbankcard', + ] + }, + { + 'prefix': 'imagepp/v1', + 'paths': [ + '/licenseplate', + '/recognizetext', + '/mergeface' + ] + } +] + +_APIS = [(i['prefix'], [p.split('/')[1:] for p in i['paths']]) for i in _APIS] diff --git a/app/lib/face/structures.py b/app/lib/face/structures.py new file mode 100755 index 0000000..baddb02 --- /dev/null +++ b/app/lib/face/structures.py @@ -0,0 +1,19 @@ + + +class ObjectDict(dict): + """Dictionary object for json decode""" + + def __getattr__(self, name): + if name in self: + return self[name] + else: + raise AttributeError("No such attribute: " + name) + + def __setattr__(self, name, value): + self[name] = value + + def __delattr__(self, name): + if name in self: + del self[name] + else: + raise AttributeError("No such attribute: " + name) \ No newline at end of file diff --git a/app/lib/facebody/.pydio b/app/lib/facebody/.pydio new file mode 100644 index 0000000..aa42594 --- /dev/null +++ b/app/lib/facebody/.pydio @@ -0,0 +1 @@ +dce8dc79-07b1-4fae-ba88-3457205e15bd \ No newline at end of file diff --git a/app/lib/facebody/ChangeLog.txt b/app/lib/facebody/ChangeLog.txt new file mode 100755 index 0000000..b506237 --- /dev/null +++ b/app/lib/facebody/ChangeLog.txt @@ -0,0 +1,140 @@ +2021-05-14 Version: 1.2.21 +- Release ExtractFingerPrint. + +2021-04-29 Version: 1.2.20 +- Update RecognizeFace. + +2021-04-06 Version: 1.2.19 +- Release MonitorExamination. + +2021-03-11 Version: 1.2.18 +- Update DetectIPCPedestrian. + +2021-03-04 Version: 1.2.17 +- Release RecognizeHandGesture. + +2021-03-04 Version: 2.0.7 +- Release RecognizeHandGesture. + +2021-03-03 Version: 1.2.16 +- Update Compareface. + +2021-02-19 Version: 1.2.2 +- Release GenerateHumanAnimeStyle CountCrowd. + +2021-02-19 Version: 1.2.2 +- Release GenerateHumanAnimeStyle CountCrowd. + +2021-02-19 Version: 1.2.2 +- Release GenerateHumanAnimeStyle CountCrowd. + +2021-02-19 Version: 1.2.13 +- Release GenerateHumanSketchStyle MergeImageFace AddFaceImageTemplate QueryFaceImageTemplate DeleteFaceImageTemplate. + +2021-02-08 Version: 1.2.15 +- Update PedestrianDetectAttribute. + +2021-02-01 Version: 1.2.14 +- Release GenerateHumanSketchStyle MergeImageFace AddFaceImageTemplate QueryFaceImageTemplate DeleteFaceImageTemplate. + +2021-02-01 Version: 1.2.13 +- Release GenerateHumanSketchStyle MergeImageFace AddFaceImageTemplate QueryFaceImageTemplate DeleteFaceImageTemplate. + +2021-01-12 Version: 1.2.12 +- Update ExtractPedestrianFeatureAttr. + +2020-12-28 Version: 1.2.11 +- Release GenRealPersonVerificationToken GetRealPersonVerificationResult. + +2020-12-24 Version: 1.2.10 +- Release CreateBodyDb ListBodyDbs DeleteBodyDb CreateBodyPerson GetBodyPerson ListBodyPerson DeleteBodyPerson AddBodyTrace SearchBodyTrace. + +2020-12-23 Version: 1.2.9 +- Release DetectPedestrianIntrusion. + +2020-12-22 Version: 1.2.8 +- Release InterpolateVideoFrame. + +2020-11-24 Version: 1.2.7 +- Update SearchFace. + +2020-11-20 Version: 1.2.6 +- Update DetectFace. +- Update RecognizeFace. + +2020-11-20 Version: 1.2.6 +- Update DetectFace. +- Update RecognizeFace. + +2020-11-19 Version: 1.2.3 +- Update GenerateHumanAnimeStyle. + +2020-11-13 Version: 1.2.2 +- Release GenerateHumanAnimeStyle CountCrowd. + +2020-10-13 Version: 1.2.1 +- Release PedestrianDetectAttribute. + +2020-09-17 Version: 1.1.9.ROA +- Add Api DetectIPCPedestrianOptimized. + +2020-09-09 Version: 1.2.0 +- Release DetectChefCap. + +2020-09-09 Version: 1.1.10 +- Release DetectChefCap. + +2020-09-09 Version: 1.1.7 +- Release DetectChefCap. + +2020-08-25 Version: 1.1.6 +- Release ExtractPedestrianFeatureAttribute and BlurFace. + +2020-08-14 Version: 1.1.5 +- Supported Api DetectIPCPedestrian. + +2020-08-03 Version: 1.1.4 +- Add ExtractPedestrianFeatureAttribute. + +2020-07-30 Version: 1.1.3 +- Update DetectCelebrity. + +2020-07-30 Version: 1.1.2 +- Add DetectCelebrity. + +2020-07-01 Version: 1.1.1 +- Sdk version 111. + +2020-05-29 Version: 1.1.0 +- Sdk version 111. + +2020-05-12 Version: 1.0.9 +- Sdk version 109. + +2020-04-07 Version: 1.0.8 +- Generated 2019-12-30 for `facebody`. + +2020-03-23 Version: 1.0.7 +- Sdk version 107. + +2020-02-27 Version: 1.0.6 +- Sdk version 106. + +2020-02-09 Version: 1.0.4 +- Sdk version 104. + +2020-02-08 Version: 1.0.3 +- Add DetectMask Api. + +2020-01-20 Version: 1.0.1 +- Onezeroone sdk version. + +2019-12-30 Version: 1.0.2 +- Disable Base64 Image string data support. + +2019-12-29 Version: 1.0.1 +- Add new api. + +2019-12-18 Version: 1.0.0 +- First sdk version. + diff --git a/app/lib/facebody/LICENSE b/app/lib/facebody/LICENSE new file mode 100755 index 0000000..85815c8 --- /dev/null +++ b/app/lib/facebody/LICENSE @@ -0,0 +1,13 @@ +Copyright 1999-present Alibaba Group Holding Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/app/lib/facebody/MANIFEST.in b/app/lib/facebody/MANIFEST.in new file mode 100755 index 0000000..03d3d04 --- /dev/null +++ b/app/lib/facebody/MANIFEST.in @@ -0,0 +1 @@ +include LICENSE README.rst ChangeLog.txt \ No newline at end of file diff --git a/app/lib/facebody/README.rst b/app/lib/facebody/README.rst new file mode 100755 index 0000000..324c364 --- /dev/null +++ b/app/lib/facebody/README.rst @@ -0,0 +1,15 @@ +============================================================= +aliyun-python-sdk-facebody +============================================================= + +.. This is the facebody module of Aliyun Python SDK. + +Aliyun Python SDK is the official software development kit. It makes things easy to integrate your Python application, library, or script with Aliyun services. + +This module works on Python versions: + +2.6.5 and greater + +**Documentation:** + +Please visit `http://develop.aliyun.com/sdk/python `_ diff --git a/app/lib/facebody/aliyunsdkfacebody/.pydio b/app/lib/facebody/aliyunsdkfacebody/.pydio new file mode 100644 index 0000000..263f995 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/.pydio @@ -0,0 +1 @@ +f69e9afe-bafb-48b1-97ae-88401e175fde \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/__init__.py b/app/lib/facebody/aliyunsdkfacebody/__init__.py new file mode 100755 index 0000000..b1a1413 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/__init__.py @@ -0,0 +1 @@ +__version__ = '1.2.21' \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/endpoint.py b/app/lib/facebody/aliyunsdkfacebody/endpoint.py new file mode 100755 index 0000000..b2cd608 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/endpoint.py @@ -0,0 +1,33 @@ +# # Licensed to the Apache Software Foundation (ASF) under one +# # or more contributor license agreements. See the NOTICE file +# # distributed with this work for additional information +# # regarding copyright ownership. The ASF licenses this file +# # to you under the Apache License, Version 2.0 (the +# # "License"); you may not use this file except in compliance +# # with the License. You may obtain a copy of the License at +# # +# # +# # http://www.apache.org/licenses/LICENSE-2.0 +# # +# # +# # Unless required by applicable law or agreed to in writing, +# # software distributed under the License is distributed on an +# # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# # KIND, either express or implied. See the License for the +# # specific language governing permissions and limitations +# # under the License. + + +class EndpointData(): + def __init__(self): + self.endpoint_map = {} + self.endpoint_regional = "regional" + + def getEndpointMap(self): + return self.endpoint_map + + def getEndpointRegional(self): + return self.endpoint_regional + + +endpoint_data = EndpointData() diff --git a/app/lib/facebody/aliyunsdkfacebody/request/.pydio b/app/lib/facebody/aliyunsdkfacebody/request/.pydio new file mode 100644 index 0000000..3dff084 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/.pydio @@ -0,0 +1 @@ +f91707f5-283a-4e80-87ed-9ff465c5a243 \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/__init__.py b/app/lib/facebody/aliyunsdkfacebody/request/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/.pydio b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/.pydio new file mode 100644 index 0000000..5db224f --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/.pydio @@ -0,0 +1 @@ +2a1f3697-b267-4f0a-8915-b589ae654d79 \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddBodyTraceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddBodyTraceRequest.py new file mode 100755 index 0000000..9a67566 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddBodyTraceRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class AddBodyTraceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'AddBodyTrace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ExtraData(self): + return self.get_body_params().get('ExtraData') + + def set_ExtraData(self,ExtraData): + self.add_body_params('ExtraData', ExtraData) + + def get_PersonId(self): + return self.get_body_params().get('PersonId') + + def set_PersonId(self,PersonId): + self.add_body_params('PersonId', PersonId) + + def get_Images(self): + return self.get_body_params().get('Images') + + def set_Images(self,Images): + self.add_body_params('Images', Images) + + def get_DbId(self): + return self.get_body_params().get('DbId') + + def set_DbId(self,DbId): + self.add_body_params('DbId', DbId) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceEntityRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceEntityRequest.py new file mode 100755 index 0000000..d0df1d5 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceEntityRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class AddFaceEntityRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'AddFaceEntity','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_EntityId(self): + return self.get_body_params().get('EntityId') + + def set_EntityId(self,EntityId): + self.add_body_params('EntityId', EntityId) + + def get_Labels(self): + return self.get_body_params().get('Labels') + + def set_Labels(self,Labels): + self.add_body_params('Labels', Labels) + + def get_DbName(self): + return self.get_body_params().get('DbName') + + def set_DbName(self,DbName): + self.add_body_params('DbName', DbName) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceImageTemplateRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceImageTemplateRequest.py new file mode 100755 index 0000000..37029fb --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceImageTemplateRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class AddFaceImageTemplateRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'AddFaceImageTemplate','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_UserId(self): + return self.get_body_params().get('UserId') + + def set_UserId(self,UserId): + self.add_body_params('UserId', UserId) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceRequest.py new file mode 100755 index 0000000..9bef277 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/AddFaceRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class AddFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'AddFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_EntityId(self): + return self.get_body_params().get('EntityId') + + def set_EntityId(self,EntityId): + self.add_body_params('EntityId', EntityId) + + def get_ExtraData(self): + return self.get_body_params().get('ExtraData') + + def set_ExtraData(self,ExtraData): + self.add_body_params('ExtraData', ExtraData) + + def get_DbName(self): + return self.get_body_params().get('DbName') + + def set_DbName(self,DbName): + self.add_body_params('DbName', DbName) + + def get_ImageUrl(self): + return self.get_body_params().get('ImageUrl') + + def set_ImageUrl(self,ImageUrl): + self.add_body_params('ImageUrl', ImageUrl) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/BlurFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/BlurFaceRequest.py new file mode 100755 index 0000000..6f65854 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/BlurFaceRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class BlurFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'BlurFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/BodyPostureRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/BodyPostureRequest.py new file mode 100755 index 0000000..05da9d0 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/BodyPostureRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class BodyPostureRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'BodyPosture','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CompareFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CompareFaceRequest.py new file mode 100755 index 0000000..c14e5f9 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CompareFaceRequest.py @@ -0,0 +1,62 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class CompareFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'CompareFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageDataA(self): + return self.get_body_params().get('ImageDataA') + + def set_ImageDataA(self,ImageDataA): + self.add_body_params('ImageDataA', ImageDataA) + + def get_ImageDataB(self): + return self.get_body_params().get('ImageDataB') + + def set_ImageDataB(self,ImageDataB): + self.add_body_params('ImageDataB', ImageDataB) + + def get_QualityScoreThreshold(self): + return self.get_body_params().get('QualityScoreThreshold') + + def set_QualityScoreThreshold(self,QualityScoreThreshold): + self.add_body_params('QualityScoreThreshold', QualityScoreThreshold) + + def get_ImageURLB(self): + return self.get_body_params().get('ImageURLB') + + def set_ImageURLB(self,ImageURLB): + self.add_body_params('ImageURLB', ImageURLB) + + def get_ImageURLA(self): + return self.get_body_params().get('ImageURLA') + + def set_ImageURLA(self,ImageURLA): + self.add_body_params('ImageURLA', ImageURLA) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CountCrowdRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CountCrowdRequest.py new file mode 100755 index 0000000..f223eb1 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CountCrowdRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class CountCrowdRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'CountCrowd','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_IsShow(self): + return self.get_body_params().get('IsShow') + + def set_IsShow(self,IsShow): + self.add_body_params('IsShow', IsShow) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateBodyDbRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateBodyDbRequest.py new file mode 100755 index 0000000..4c0b77c --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateBodyDbRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class CreateBodyDbRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'CreateBodyDb','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Name(self): + return self.get_body_params().get('Name') + + def set_Name(self,Name): + self.add_body_params('Name', Name) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateBodyPersonRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateBodyPersonRequest.py new file mode 100755 index 0000000..225e5f9 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateBodyPersonRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class CreateBodyPersonRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'CreateBodyPerson','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_DbId(self): + return self.get_body_params().get('DbId') + + def set_DbId(self,DbId): + self.add_body_params('DbId', DbId) + + def get_Name(self): + return self.get_body_params().get('Name') + + def set_Name(self,Name): + self.add_body_params('Name', Name) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateFaceDbRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateFaceDbRequest.py new file mode 100755 index 0000000..f4aff31 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/CreateFaceDbRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class CreateFaceDbRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'CreateFaceDb','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Name(self): + return self.get_body_params().get('Name') + + def set_Name(self,Name): + self.add_body_params('Name', Name) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteBodyDbRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteBodyDbRequest.py new file mode 100755 index 0000000..df101a8 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteBodyDbRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DeleteBodyDbRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DeleteBodyDb','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Id(self): + return self.get_body_params().get('Id') + + def set_Id(self,Id): + self.add_body_params('Id', Id) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteBodyPersonRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteBodyPersonRequest.py new file mode 100755 index 0000000..ee6ff57 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteBodyPersonRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DeleteBodyPersonRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DeleteBodyPerson','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_PersonId(self): + return self.get_body_params().get('PersonId') + + def set_PersonId(self,PersonId): + self.add_body_params('PersonId', PersonId) + + def get_DbId(self): + return self.get_body_params().get('DbId') + + def set_DbId(self,DbId): + self.add_body_params('DbId', DbId) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceDbRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceDbRequest.py new file mode 100755 index 0000000..435cdb6 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceDbRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DeleteFaceDbRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DeleteFaceDb','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Name(self): + return self.get_body_params().get('Name') + + def set_Name(self,Name): + self.add_body_params('Name', Name) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceEntityRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceEntityRequest.py new file mode 100755 index 0000000..55c098c --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceEntityRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DeleteFaceEntityRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DeleteFaceEntity','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_EntityId(self): + return self.get_body_params().get('EntityId') + + def set_EntityId(self,EntityId): + self.add_body_params('EntityId', EntityId) + + def get_DbName(self): + return self.get_body_params().get('DbName') + + def set_DbName(self,DbName): + self.add_body_params('DbName', DbName) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceImageTemplateRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceImageTemplateRequest.py new file mode 100755 index 0000000..75de825 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceImageTemplateRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DeleteFaceImageTemplateRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DeleteFaceImageTemplate','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_UserId(self): + return self.get_body_params().get('UserId') + + def set_UserId(self,UserId): + self.add_body_params('UserId', UserId) + + def get_TemplateId(self): + return self.get_body_params().get('TemplateId') + + def set_TemplateId(self,TemplateId): + self.add_body_params('TemplateId', TemplateId) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceRequest.py new file mode 100755 index 0000000..f7ff299 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DeleteFaceRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DeleteFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DeleteFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_FaceId(self): + return self.get_body_params().get('FaceId') + + def set_FaceId(self,FaceId): + self.add_body_params('FaceId', FaceId) + + def get_DbName(self): + return self.get_body_params().get('DbName') + + def set_DbName(self,DbName): + self.add_body_params('DbName', DbName) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectBodyCountRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectBodyCountRequest.py new file mode 100755 index 0000000..7ed9567 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectBodyCountRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectBodyCountRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectBodyCount','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectCelebrityRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectCelebrityRequest.py new file mode 100755 index 0000000..67cfd57 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectCelebrityRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectCelebrityRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectCelebrity','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectChefCapRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectChefCapRequest.py new file mode 100755 index 0000000..ca91d5b --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectChefCapRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectChefCapRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectChefCap','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectFaceRequest.py new file mode 100755 index 0000000..6c18cf6 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectFaceRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectIPCPedestrianRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectIPCPedestrianRequest.py new file mode 100755 index 0000000..2766deb --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectIPCPedestrianRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectIPCPedestrianRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectIPCPedestrian','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Height(self): + return self.get_body_params().get('Height') + + def set_Height(self,Height): + self.add_body_params('Height', Height) + + def get_ImageData(self): + return self.get_body_params().get('ImageData') + + def set_ImageData(self,ImageData): + self.add_body_params('ImageData', ImageData) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) + + def get_Width(self): + return self.get_body_params().get('Width') + + def set_Width(self,Width): + self.add_body_params('Width', Width) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectLivingFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectLivingFaceRequest.py new file mode 100755 index 0000000..5040e0a --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectLivingFaceRequest.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectLivingFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectLivingFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Taskss(self): + return self.get_body_params().get('Tasks') + + def set_Taskss(self, Taskss): + for depth1 in range(len(Taskss)): + if Taskss[depth1].get('ImageURL') is not None: + self.add_body_params('Tasks.' + str(depth1 + 1) + '.ImageURL', Taskss[depth1].get('ImageURL')) + if Taskss[depth1].get('ImageData') is not None: + self.add_body_params('Tasks.' + str(depth1 + 1) + '.ImageData', Taskss[depth1].get('ImageData')) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectMaskRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectMaskRequest.py new file mode 100755 index 0000000..d836b8a --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectMaskRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectMaskRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectMask','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectPedestrianIntrusionRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectPedestrianIntrusionRequest.py new file mode 100755 index 0000000..1857407 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectPedestrianIntrusionRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectPedestrianIntrusionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectPedestrianIntrusion','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_DetectRegion(self): + return self.get_body_params().get('DetectRegion') + + def set_DetectRegion(self,DetectRegion): + self.add_body_params('DetectRegion', DetectRegion) + + def get_RegionType(self): + return self.get_body_params().get('RegionType') + + def set_RegionType(self,RegionType): + self.add_body_params('RegionType', RegionType) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectPedestrianRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectPedestrianRequest.py new file mode 100755 index 0000000..068a96a --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectPedestrianRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectPedestrianRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectPedestrian','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectVideoLivingFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectVideoLivingFaceRequest.py new file mode 100755 index 0000000..497dfce --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/DetectVideoLivingFaceRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class DetectVideoLivingFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectVideoLivingFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_VideoUrl(self): + return self.get_body_params().get('VideoUrl') + + def set_VideoUrl(self,VideoUrl): + self.add_body_params('VideoUrl', VideoUrl) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/EnhanceFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/EnhanceFaceRequest.py new file mode 100755 index 0000000..dea5271 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/EnhanceFaceRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class EnhanceFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'EnhanceFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractFingerPrintRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractFingerPrintRequest.py new file mode 100755 index 0000000..1286480 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractFingerPrintRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class ExtractFingerPrintRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'ExtractFingerPrint','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageData(self): + return self.get_body_params().get('ImageData') + + def set_ImageData(self,ImageData): + self.add_body_params('ImageData', ImageData) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractPedestrianFeatureAttrRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractPedestrianFeatureAttrRequest.py new file mode 100755 index 0000000..92e8a5f --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractPedestrianFeatureAttrRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class ExtractPedestrianFeatureAttrRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'ExtractPedestrianFeatureAttr','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Mode(self): + return self.get_body_params().get('Mode') + + def set_Mode(self,Mode): + self.add_body_params('Mode', Mode) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) + + def get_ServiceVersion(self): + return self.get_body_params().get('ServiceVersion') + + def set_ServiceVersion(self,ServiceVersion): + self.add_body_params('ServiceVersion', ServiceVersion) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractPedestrianFeatureAttributeRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractPedestrianFeatureAttributeRequest.py new file mode 100755 index 0000000..10f5475 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ExtractPedestrianFeatureAttributeRequest.py @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class ExtractPedestrianFeatureAttributeRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'ExtractPedestrianFeatureAttribute','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_UrlLists(self): + return self.get_body_params().get('UrlList') + + def set_UrlLists(self, UrlLists): + for depth1 in range(len(UrlLists)): + if UrlLists[depth1].get('Url') is not None: + self.add_body_params('UrlList.' + str(depth1 + 1) + '.Url', UrlLists[depth1].get('Url')) + + def get_Mode(self): + return self.get_body_params().get('Mode') + + def set_Mode(self,Mode): + self.add_body_params('Mode', Mode) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceBeautyRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceBeautyRequest.py new file mode 100755 index 0000000..e6d76ac --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceBeautyRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class FaceBeautyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'FaceBeauty','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_White(self): + return self.get_body_params().get('White') + + def set_White(self,White): + self.add_body_params('White', White) + + def get_Smooth(self): + return self.get_body_params().get('Smooth') + + def set_Smooth(self,Smooth): + self.add_body_params('Smooth', Smooth) + + def get_Sharp(self): + return self.get_body_params().get('Sharp') + + def set_Sharp(self,Sharp): + self.add_body_params('Sharp', Sharp) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceFilterRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceFilterRequest.py new file mode 100755 index 0000000..cf52480 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceFilterRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class FaceFilterRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'FaceFilter','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Strength(self): + return self.get_body_params().get('Strength') + + def set_Strength(self,Strength): + self.add_body_params('Strength', Strength) + + def get_ResourceType(self): + return self.get_body_params().get('ResourceType') + + def set_ResourceType(self,ResourceType): + self.add_body_params('ResourceType', ResourceType) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceMakeupRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceMakeupRequest.py new file mode 100755 index 0000000..a7e608d --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceMakeupRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class FaceMakeupRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'FaceMakeup','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Strength(self): + return self.get_body_params().get('Strength') + + def set_Strength(self,Strength): + self.add_body_params('Strength', Strength) + + def get_MakeupType(self): + return self.get_body_params().get('MakeupType') + + def set_MakeupType(self,MakeupType): + self.add_body_params('MakeupType', MakeupType) + + def get_ResourceType(self): + return self.get_body_params().get('ResourceType') + + def set_ResourceType(self,ResourceType): + self.add_body_params('ResourceType', ResourceType) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceTidyupRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceTidyupRequest.py new file mode 100755 index 0000000..f8b752f --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/FaceTidyupRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class FaceTidyupRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'FaceTidyup','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ShapeType(self): + return self.get_body_params().get('ShapeType') + + def set_ShapeType(self,ShapeType): + self.add_body_params('ShapeType', ShapeType) + + def get_Strength(self): + return self.get_body_params().get('Strength') + + def set_Strength(self,Strength): + self.add_body_params('Strength', Strength) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenRealPersonVerificationTokenRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenRealPersonVerificationTokenRequest.py new file mode 100755 index 0000000..0a89c2a --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenRealPersonVerificationTokenRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class GenRealPersonVerificationTokenRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'GenRealPersonVerificationToken','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_CertificateNumber(self): + return self.get_body_params().get('CertificateNumber') + + def set_CertificateNumber(self,CertificateNumber): + self.add_body_params('CertificateNumber', CertificateNumber) + + def get_CertificateName(self): + return self.get_body_params().get('CertificateName') + + def set_CertificateName(self,CertificateName): + self.add_body_params('CertificateName', CertificateName) + + def get_MetaInfo(self): + return self.get_body_params().get('MetaInfo') + + def set_MetaInfo(self,MetaInfo): + self.add_body_params('MetaInfo', MetaInfo) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenerateHumanAnimeStyleRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenerateHumanAnimeStyleRequest.py new file mode 100755 index 0000000..1b61ec5 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenerateHumanAnimeStyleRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class GenerateHumanAnimeStyleRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'GenerateHumanAnimeStyle','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_AlgoType(self): + return self.get_query_params().get('AlgoType') + + def set_AlgoType(self,AlgoType): + self.add_query_param('AlgoType',AlgoType) + + def get_ImageURL(self): + return self.get_query_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_query_param('ImageURL',ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenerateHumanSketchStyleRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenerateHumanSketchStyleRequest.py new file mode 100755 index 0000000..14285d7 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GenerateHumanSketchStyleRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class GenerateHumanSketchStyleRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'GenerateHumanSketchStyle','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ReturnType(self): + return self.get_body_params().get('ReturnType') + + def set_ReturnType(self,ReturnType): + self.add_body_params('ReturnType', ReturnType) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetBodyPersonRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetBodyPersonRequest.py new file mode 100755 index 0000000..3e1626d --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetBodyPersonRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class GetBodyPersonRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'GetBodyPerson','facebody') + self.set_method('GET') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_PersonId(self): + return self.get_query_params().get('PersonId') + + def set_PersonId(self,PersonId): + self.add_query_param('PersonId',PersonId) + + def get_DbId(self): + return self.get_query_params().get('DbId') + + def set_DbId(self,DbId): + self.add_query_param('DbId',DbId) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetFaceEntityRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetFaceEntityRequest.py new file mode 100755 index 0000000..4f67c4b --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetFaceEntityRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class GetFaceEntityRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'GetFaceEntity','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_EntityId(self): + return self.get_body_params().get('EntityId') + + def set_EntityId(self,EntityId): + self.add_body_params('EntityId', EntityId) + + def get_DbName(self): + return self.get_body_params().get('DbName') + + def set_DbName(self,DbName): + self.add_body_params('DbName', DbName) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetRealPersonVerificationResultRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetRealPersonVerificationResultRequest.py new file mode 100755 index 0000000..74f6fe3 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/GetRealPersonVerificationResultRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class GetRealPersonVerificationResultRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'GetRealPersonVerificationResult','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_MaterialHash(self): + return self.get_body_params().get('MaterialHash') + + def set_MaterialHash(self,MaterialHash): + self.add_body_params('MaterialHash', MaterialHash) + + def get_VerificationToken(self): + return self.get_body_params().get('VerificationToken') + + def set_VerificationToken(self,VerificationToken): + self.add_body_params('VerificationToken', VerificationToken) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/HandPostureRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/HandPostureRequest.py new file mode 100755 index 0000000..05aa0df --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/HandPostureRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class HandPostureRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'HandPosture','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListBodyDbsRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListBodyDbsRequest.py new file mode 100755 index 0000000..d46118a --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListBodyDbsRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class ListBodyDbsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'ListBodyDbs','facebody') + self.set_method('GET') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Limit(self): + return self.get_query_params().get('Limit') + + def set_Limit(self,Limit): + self.add_query_param('Limit',Limit) + + def get_Offset(self): + return self.get_query_params().get('Offset') + + def set_Offset(self,Offset): + self.add_query_param('Offset',Offset) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListBodyPersonRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListBodyPersonRequest.py new file mode 100755 index 0000000..7a55c4d --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListBodyPersonRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class ListBodyPersonRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'ListBodyPerson','facebody') + self.set_method('GET') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Limit(self): + return self.get_query_params().get('Limit') + + def set_Limit(self,Limit): + self.add_query_param('Limit',Limit) + + def get_Offset(self): + return self.get_query_params().get('Offset') + + def set_Offset(self,Offset): + self.add_query_param('Offset',Offset) + + def get_DbId(self): + return self.get_query_params().get('DbId') + + def set_DbId(self,DbId): + self.add_query_param('DbId',DbId) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListFaceDbsRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListFaceDbsRequest.py new file mode 100755 index 0000000..791d5fa --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListFaceDbsRequest.py @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class ListFaceDbsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'ListFaceDbs','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListFaceEntitiesRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListFaceEntitiesRequest.py new file mode 100755 index 0000000..1f861b5 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/ListFaceEntitiesRequest.py @@ -0,0 +1,74 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class ListFaceEntitiesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'ListFaceEntities','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_EntityIdPrefix(self): + return self.get_body_params().get('EntityIdPrefix') + + def set_EntityIdPrefix(self,EntityIdPrefix): + self.add_body_params('EntityIdPrefix', EntityIdPrefix) + + def get_Limit(self): + return self.get_body_params().get('Limit') + + def set_Limit(self,Limit): + self.add_body_params('Limit', Limit) + + def get_Order(self): + return self.get_body_params().get('Order') + + def set_Order(self,Order): + self.add_body_params('Order', Order) + + def get_Offset(self): + return self.get_body_params().get('Offset') + + def set_Offset(self,Offset): + self.add_body_params('Offset', Offset) + + def get_Token(self): + return self.get_body_params().get('Token') + + def set_Token(self,Token): + self.add_body_params('Token', Token) + + def get_Labels(self): + return self.get_body_params().get('Labels') + + def set_Labels(self,Labels): + self.add_body_params('Labels', Labels) + + def get_DbName(self): + return self.get_body_params().get('DbName') + + def set_DbName(self,DbName): + self.add_body_params('DbName', DbName) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/MergeImageFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/MergeImageFaceRequest.py new file mode 100755 index 0000000..9e4ccbc --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/MergeImageFaceRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class MergeImageFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'MergeImageFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_UserId(self): + return self.get_body_params().get('UserId') + + def set_UserId(self,UserId): + self.add_body_params('UserId', UserId) + + def get_TemplateId(self): + return self.get_body_params().get('TemplateId') + + def set_TemplateId(self,TemplateId): + self.add_body_params('TemplateId', TemplateId) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/MonitorExaminationRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/MonitorExaminationRequest.py new file mode 100755 index 0000000..a2f2a25 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/MonitorExaminationRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class MonitorExaminationRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'MonitorExamination','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Type(self): + return self.get_body_params().get('Type') + + def set_Type(self,Type): + self.add_body_params('Type', Type) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/PedestrianDetectAttributeRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/PedestrianDetectAttributeRequest.py new file mode 100755 index 0000000..d24f1c1 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/PedestrianDetectAttributeRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class PedestrianDetectAttributeRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'PedestrianDetectAttribute','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/QueryFaceImageTemplateRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/QueryFaceImageTemplateRequest.py new file mode 100755 index 0000000..a287ef3 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/QueryFaceImageTemplateRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class QueryFaceImageTemplateRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'QueryFaceImageTemplate','facebody') + self.set_method('GET') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_UserId(self): + return self.get_query_params().get('UserId') + + def set_UserId(self,UserId): + self.add_query_param('UserId',UserId) + + def get_TemplateId(self): + return self.get_query_params().get('TemplateId') + + def set_TemplateId(self,TemplateId): + self.add_query_param('TemplateId',TemplateId) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeActionRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeActionRequest.py new file mode 100755 index 0000000..a773024 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeActionRequest.py @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class RecognizeActionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'RecognizeAction','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Type(self): + return self.get_body_params().get('Type') + + def set_Type(self,Type): + self.add_body_params('Type', Type) + + def get_VideoData(self): + return self.get_body_params().get('VideoData') + + def set_VideoData(self,VideoData): + self.add_body_params('VideoData', VideoData) + + def get_URLLists(self): + return self.get_body_params().get('URLList') + + def set_URLLists(self, URLLists): + for depth1 in range(len(URLLists)): + if URLLists[depth1].get('imageData') is not None: + self.add_body_params('URLList.' + str(depth1 + 1) + '.imageData', URLLists[depth1].get('imageData')) + if URLLists[depth1].get('URL') is not None: + self.add_body_params('URLList.' + str(depth1 + 1) + '.URL', URLLists[depth1].get('URL')) + + def get_VideoUrl(self): + return self.get_body_params().get('VideoUrl') + + def set_VideoUrl(self,VideoUrl): + self.add_body_params('VideoUrl', VideoUrl) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeExpressionRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeExpressionRequest.py new file mode 100755 index 0000000..9a818ff --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeExpressionRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class RecognizeExpressionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'RecognizeExpression','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeFaceRequest.py new file mode 100755 index 0000000..4f64bdf --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeFaceRequest.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class RecognizeFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'RecognizeFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeHandGestureRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeHandGestureRequest.py new file mode 100755 index 0000000..39d5da7 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizeHandGestureRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class RecognizeHandGestureRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'RecognizeHandGesture','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_GestureType(self): + return self.get_body_params().get('GestureType') + + def set_GestureType(self,GestureType): + self.add_body_params('GestureType', GestureType) + + def get_AppId(self): + return self.get_body_params().get('AppId') + + def set_AppId(self,AppId): + self.add_body_params('AppId', AppId) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizePublicFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizePublicFaceRequest.py new file mode 100755 index 0000000..cd83484 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/RecognizePublicFaceRequest.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class RecognizePublicFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'RecognizePublicFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Tasks(self): + return self.get_body_params().get('Task') + + def set_Tasks(self, Tasks): + for depth1 in range(len(Tasks)): + if Tasks[depth1].get('ImageURL') is not None: + self.add_body_params('Task.' + str(depth1 + 1) + '.ImageURL', Tasks[depth1].get('ImageURL')) + if Tasks[depth1].get('ImageData') is not None: + self.add_body_params('Task.' + str(depth1 + 1) + '.ImageData', Tasks[depth1].get('ImageData')) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SearchBodyTraceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SearchBodyTraceRequest.py new file mode 100755 index 0000000..3275da2 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SearchBodyTraceRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class SearchBodyTraceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'SearchBodyTrace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_MinScore(self): + return self.get_body_params().get('MinScore') + + def set_MinScore(self,MinScore): + self.add_body_params('MinScore', MinScore) + + def get_Limit(self): + return self.get_body_params().get('Limit') + + def set_Limit(self,Limit): + self.add_body_params('Limit', Limit) + + def get_Images(self): + return self.get_body_params().get('Images') + + def set_Images(self,Images): + self.add_body_params('Images', Images) + + def get_DbId(self): + return self.get_body_params().get('DbId') + + def set_DbId(self,DbId): + self.add_body_params('DbId', DbId) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SearchFaceRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SearchFaceRequest.py new file mode 100755 index 0000000..a0a2116 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SearchFaceRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class SearchFaceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'SearchFace','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_Limit(self): + return self.get_body_params().get('Limit') + + def set_Limit(self,Limit): + self.add_body_params('Limit', Limit) + + def get_DbNames(self): + return self.get_query_params().get('DbNames') + + def set_DbNames(self,DbNames): + self.add_query_param('DbNames',DbNames) + + def get_DbName(self): + return self.get_body_params().get('DbName') + + def set_DbName(self,DbName): + self.add_body_params('DbName', DbName) + + def get_ImageUrl(self): + return self.get_body_params().get('ImageUrl') + + def set_ImageUrl(self,ImageUrl): + self.add_body_params('ImageUrl', ImageUrl) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SwapFacialFeaturesRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SwapFacialFeaturesRequest.py new file mode 100755 index 0000000..873dca6 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/SwapFacialFeaturesRequest.py @@ -0,0 +1,62 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class SwapFacialFeaturesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'SwapFacialFeatures','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_TargetImageURL(self): + return self.get_body_params().get('TargetImageURL') + + def set_TargetImageURL(self,TargetImageURL): + self.add_body_params('TargetImageURL', TargetImageURL) + + def get_SourceImageData(self): + return self.get_body_params().get('SourceImageData') + + def set_SourceImageData(self,SourceImageData): + self.add_body_params('SourceImageData', SourceImageData) + + def get_SourceImageURL(self): + return self.get_body_params().get('SourceImageURL') + + def set_SourceImageURL(self,SourceImageURL): + self.add_body_params('SourceImageURL', SourceImageURL) + + def get_TargetImageData(self): + return self.get_body_params().get('TargetImageData') + + def set_TargetImageData(self,TargetImageData): + self.add_body_params('TargetImageData', TargetImageData) + + def get_EditPart(self): + return self.get_body_params().get('EditPart') + + def set_EditPart(self,EditPart): + self.add_body_params('EditPart', EditPart) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/UpdateFaceEntityRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/UpdateFaceEntityRequest.py new file mode 100755 index 0000000..6f04746 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/UpdateFaceEntityRequest.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class UpdateFaceEntityRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'UpdateFaceEntity','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_EntityId(self): + return self.get_body_params().get('EntityId') + + def set_EntityId(self,EntityId): + self.add_body_params('EntityId', EntityId) + + def get_Labels(self): + return self.get_body_params().get('Labels') + + def set_Labels(self,Labels): + self.add_body_params('Labels', Labels) + + def get_DbName(self): + return self.get_body_params().get('DbName') + + def set_DbName(self,DbName): + self.add_body_params('DbName', DbName) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/VerifyFaceMaskRequest.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/VerifyFaceMaskRequest.py new file mode 100755 index 0000000..407b7a7 --- /dev/null +++ b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/VerifyFaceMaskRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkfacebody.endpoint import endpoint_data + +class VerifyFaceMaskRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'facebody', '2019-12-30', 'VerifyFaceMask','facebody') + self.set_method('POST') + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + + def get_RefData(self): + return self.get_body_params().get('RefData') + + def set_RefData(self,RefData): + self.add_body_params('RefData', RefData) + + def get_ImageData(self): + return self.get_body_params().get('ImageData') + + def set_ImageData(self,ImageData): + self.add_body_params('ImageData', ImageData) + + def get_ImageURL(self): + return self.get_body_params().get('ImageURL') + + def set_ImageURL(self,ImageURL): + self.add_body_params('ImageURL', ImageURL) + + def get_RefUrl(self): + return self.get_body_params().get('RefUrl') + + def set_RefUrl(self,RefUrl): + self.add_body_params('RefUrl', RefUrl) \ No newline at end of file diff --git a/app/lib/facebody/aliyunsdkfacebody/request/v20191230/__init__.py b/app/lib/facebody/aliyunsdkfacebody/request/v20191230/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/app/lib/facebody/setup.cfg b/app/lib/facebody/setup.cfg new file mode 100755 index 0000000..5bb0111 --- /dev/null +++ b/app/lib/facebody/setup.cfg @@ -0,0 +1,5 @@ +[metadata] +license_file = LICENSE + +[bdist_wheel] +universal = 1 diff --git a/app/lib/facebody/setup.py b/app/lib/facebody/setup.py new file mode 100755 index 0000000..aea3548 --- /dev/null +++ b/app/lib/facebody/setup.py @@ -0,0 +1,78 @@ +#!/usr/bin/python +''' + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +''' + +from setuptools import setup, find_packages +import os +import sys + +""" +setup module for facebody. + +Created on 7/3/2015 + +@author: alex +""" + +PACKAGE = "aliyunsdkfacebody" +NAME = "aliyun-python-sdk-facebody" +DESCRIPTION = "The facebody module of Aliyun Python sdk." +AUTHOR = "Aliyun" +AUTHOR_EMAIL = "aliyun-developers-efficiency@list.alibaba-inc.com" +URL = "http://develop.aliyun.com/sdk/python" + +TOPDIR = os.path.dirname(__file__) or "." +VERSION = __import__(PACKAGE).__version__ + +desc_file = open("README.rst") +try: + LONG_DESCRIPTION = desc_file.read() +finally: + desc_file.close() + +setup( + name=NAME, + version=VERSION, + description=DESCRIPTION, + long_description=LONG_DESCRIPTION, + author=AUTHOR, + author_email=AUTHOR_EMAIL, + license="Apache", + url=URL, + keywords=["aliyun","sdk","facebody"], + packages=find_packages(exclude=["tests*"]), + include_package_data=True, + platforms="any", + install_requires=["aliyun-python-sdk-core>=2.11.5",], + classifiers=( + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Topic :: Software Development", + ) + +) \ No newline at end of file diff --git a/app/res/.pydio b/app/res/.pydio new file mode 100644 index 0000000..54bb8a0 --- /dev/null +++ b/app/res/.pydio @@ -0,0 +1 @@ +642b1844-ff4f-40d2-97d9-5277aae44a2b \ No newline at end of file diff --git a/app/res/img/.pydio b/app/res/img/.pydio new file mode 100644 index 0000000..ab7f57c --- /dev/null +++ b/app/res/img/.pydio @@ -0,0 +1 @@ +f0a38a75-361c-4ecb-b2a1-27bb8593617e \ No newline at end of file diff --git a/app/res/img/FaceUnlock.icns b/app/res/img/FaceUnlock.icns new file mode 100755 index 0000000..21def0c Binary files /dev/null and b/app/res/img/FaceUnlock.icns differ diff --git a/app/res/img/administrators.jpg b/app/res/img/administrators.jpg new file mode 100755 index 0000000..20795ee Binary files /dev/null and b/app/res/img/administrators.jpg differ diff --git a/app/res/img/current_user.jpg b/app/res/img/current_user.jpg new file mode 100755 index 0000000..3f96680 Binary files /dev/null and b/app/res/img/current_user.jpg differ diff --git a/app/util/.pydio b/app/util/.pydio new file mode 100644 index 0000000..94ce9b5 --- /dev/null +++ b/app/util/.pydio @@ -0,0 +1 @@ +14205bf4-de6f-41ec-b85a-a2ffdea1a0be \ No newline at end of file diff --git a/app/util/__init__.py b/app/util/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/app/util/__pycache__/.pydio b/app/util/__pycache__/.pydio new file mode 100644 index 0000000..9249eab --- /dev/null +++ b/app/util/__pycache__/.pydio @@ -0,0 +1 @@ +b4375dff-038b-459e-8990-080bb06da3fc \ No newline at end of file diff --git a/app/util/__pycache__/__init__.cpython-311.pyc b/app/util/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..18a0324 Binary files /dev/null and b/app/util/__pycache__/__init__.cpython-311.pyc differ diff --git a/app/util/__pycache__/__init__.cpython-38.pyc b/app/util/__pycache__/__init__.cpython-38.pyc new file mode 100755 index 0000000..d66a0ea Binary files /dev/null and b/app/util/__pycache__/__init__.cpython-38.pyc differ diff --git a/app/util/__pycache__/__init__.cpython-39.pyc b/app/util/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 0000000..f24e40d Binary files /dev/null and b/app/util/__pycache__/__init__.cpython-39.pyc differ diff --git a/app/util/__pycache__/apple_script.cpython-311.pyc b/app/util/__pycache__/apple_script.cpython-311.pyc new file mode 100644 index 0000000..1549985 Binary files /dev/null and b/app/util/__pycache__/apple_script.cpython-311.pyc differ diff --git a/app/util/__pycache__/apple_script.cpython-38.pyc b/app/util/__pycache__/apple_script.cpython-38.pyc new file mode 100755 index 0000000..5bf78bb Binary files /dev/null and b/app/util/__pycache__/apple_script.cpython-38.pyc differ diff --git a/app/util/__pycache__/apple_script.cpython-39.pyc b/app/util/__pycache__/apple_script.cpython-39.pyc new file mode 100755 index 0000000..f89b4c6 Binary files /dev/null and b/app/util/__pycache__/apple_script.cpython-39.pyc differ diff --git a/app/util/__pycache__/shell_execute.cpython-311.pyc b/app/util/__pycache__/shell_execute.cpython-311.pyc new file mode 100644 index 0000000..1a3b8d8 Binary files /dev/null and b/app/util/__pycache__/shell_execute.cpython-311.pyc differ diff --git a/app/util/__pycache__/shell_execute.cpython-38.pyc b/app/util/__pycache__/shell_execute.cpython-38.pyc new file mode 100755 index 0000000..39b9c6c Binary files /dev/null and b/app/util/__pycache__/shell_execute.cpython-38.pyc differ diff --git a/app/util/__pycache__/shell_execute.cpython-39.pyc b/app/util/__pycache__/shell_execute.cpython-39.pyc new file mode 100755 index 0000000..5984b16 Binary files /dev/null and b/app/util/__pycache__/shell_execute.cpython-39.pyc differ diff --git a/app/util/__pycache__/system_api.cpython-311.pyc b/app/util/__pycache__/system_api.cpython-311.pyc new file mode 100644 index 0000000..4b95f7b Binary files /dev/null and b/app/util/__pycache__/system_api.cpython-311.pyc differ diff --git a/app/util/__pycache__/system_api.cpython-38.pyc b/app/util/__pycache__/system_api.cpython-38.pyc new file mode 100755 index 0000000..3e8341a Binary files /dev/null and b/app/util/__pycache__/system_api.cpython-38.pyc differ diff --git a/app/util/__pycache__/system_api.cpython-39.pyc b/app/util/__pycache__/system_api.cpython-39.pyc new file mode 100644 index 0000000..41b0d66 Binary files /dev/null and b/app/util/__pycache__/system_api.cpython-39.pyc differ diff --git a/app/util/apple_script.py b/app/util/apple_script.py new file mode 100755 index 0000000..e42b71d --- /dev/null +++ b/app/util/apple_script.py @@ -0,0 +1,7 @@ +from app.util.shell_execute import execute + +class AppleScript: + @staticmethod + def exec(code: str, timeout=None): + stat, out, err = execute('/usr/bin/osascript', code, timeout) + return stat, out, err \ No newline at end of file diff --git a/app/util/shell_execute.py b/app/util/shell_execute.py new file mode 100755 index 0000000..8d86465 --- /dev/null +++ b/app/util/shell_execute.py @@ -0,0 +1,34 @@ +import base64 +import json +import os +import sys +import time +import traceback +from io import StringIO +from subprocess import PIPE, Popen, TimeoutExpired + +def popen(cmd, sys_env=True, **kwargs): + if sys_env and kwargs.get('env') is not None: + kwargs['env'] = os.environ.copy().update(kwargs['env']) + return Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, encoding='utf-8', **kwargs) + + +def execute(cmd, input_str=None, timeout=None, **kwargs): + p = popen(cmd, **kwargs) + try: + out, err = p.communicate(input_str, timeout=timeout) + except TimeoutExpired: + out = '' + err = get_exception() + p.kill() + stat = p.returncode + return stat, out, err + + +def get_exception(): + with StringIO() as io: + traceback.print_exc(file=io) + io.seek(0) + content = io.read() + + return content \ No newline at end of file diff --git a/app/util/system_api.py b/app/util/system_api.py new file mode 100755 index 0000000..b129f74 --- /dev/null +++ b/app/util/system_api.py @@ -0,0 +1,63 @@ +from app.util.shell_execute import execute +from app.util.apple_script import AppleScript +import Quartz +from app.config import Config +import time + +def open_url(url, new=False, wait=False, bundle: str = None, p_args=None): + args = ['/usr/bin/open'] + if new: + args.append('-n') + if wait: + args.append('-W') + if bundle: + args.append('-b') + args.append(bundle) + + args.append(url) + + if p_args is not None: + args.append('--args') + for arg in p_args: + args.append(arg) + + return execute(args) + +def open_preference(name, **kwargs): + open_url('/System/Library/PreferencePanes/%s.prefPane' % name, bundle='com.apple.systempreferences', **kwargs) + +# 获取设备信息 +def ge_device_info(): + if Config.cg_session_info is None: + Config.cg_session_info = getattr(Quartz, 'CGSessionCopyCurrentDictionary') + return Config.cg_session_info() + +def sudo(command: str, timeout=None): + stat, out, err = execute('/usr/bin/sudo -S %s' % (command), Config.password, timeout, shell=True) + return stat, out, err + +def lock_screen(): + code = '''tell application id "com.apple.ScreenSaver.Engine" to launch''' + return AppleScript.exec(code) + +def unlock(): + unlock_screen() + time.sleep(0.5) + keystroke() + time.sleep(0.5) + success() + +# 唤醒屏幕进入锁屏界面 +def unlock_screen(): + code = '''tell application "System Events" to keystroke "a" using command down''' + return AppleScript.exec(code) + +# 输入密码 +def keystroke(): + code = '''tell application "System Events" to keystroke "%s" using {}''' % (Config.password) + return AppleScript.exec(code) + +# 输完密码按下回车 +def success(): + code = '''tell application "System Events" to keystroke return using {}''' + return AppleScript.exec(code) diff --git a/requirements.txt b/requirements.txt new file mode 100755 index 0000000..95098f9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +requests +rumps +numpy +PyInstaller +py2app +pyobjc-framework-Quartz +opencv-python \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..2c5178d --- /dev/null +++ b/setup.py @@ -0,0 +1,28 @@ +from app.config import Config +import time +from setuptools import setup +APP = ['__main__.py'] +DATA_FILES = [] +OPTIONS = { + 'argv_emulation': True, + 'iconfile': 'app/res/img/FaceUnlock.icns', + 'plist': { + 'CFBundleName': Config.app_name, + 'CFBundleDisplayName': Config.app_name, + 'CFBundleGetInfoString': Config.github_page, + 'CFBundleIdentifier': Config.app_name, + 'CFBundleVersion': Config.version, + 'CFBundleShortVersionString': Config.version, + 'NSHumanReadableCopyright': "Copyright © %d, %s, All Rights Reserved" % ( + time.localtime().tm_year, Config.author), + 'LSUIElement': True, + } +} + + +setup( + app=APP, + data_files=DATA_FILES, + options={'py2app': OPTIONS}, + setup_requires=['py2app', 'rumps', 'numpy', 'requests', 'pyobjc-framework-Quartz'], +) diff --git a/笔记.txt b/笔记.txt new file mode 100755 index 0000000..655ceb0 --- /dev/null +++ b/笔记.txt @@ -0,0 +1,89 @@ +say '语音朗读' + +/usr/bin/osascript -e "display notification \" 提醒内容 \" with title \"提醒标题\"" + +屏幕立刻休眠 +/usr/bin/pmset displaysleepnow +sleepnow + + +进入屏保 +osa_api.screen_save() +tell application id "com.apple.ScreenSaver.Engine" to launch + + +open -a UnlockerX.app + +python setup.py py2app 打包 + +思路整理: + + 当前电脑解锁状态下:is_locked false + + + + +[AppleScript] Wed Jul 7 01:16:46 2021 exec + { + "code": "tell application id \"com.apple.ScreenSaver.Engine\" to launch", + "timeout": null, + "stat": 0, + "out": "", + "err": "" +} +[Info] Wed Jul 7 01:16:47 2021 callback_connect_status_changed + from "False" to "True" +[Info] Wed Jul 7 01:16:47 2021 lock_delay + None +[Info] Wed Jul 7 01:16:49 2021 callback_lock_status_changed + from "False" to "True" { + "lock_by_user": false, + "unlock_by_user": false, + "is_locked": true, + "is_sleep_wake": false, + "is_lid_wake": false, + "is_idle_wake": false +} +[AppleScript] Wed Jul 7 01:16:53 2021 exec + { + "code": "tell application \"System Events\" to keystroke \"a\" using command down", + "timeout": null, + "stat": 0, + "out": "", + "err": "" +} +[AppleScript] Wed Jul 7 01:16:53 2021 exec + { + "code": "tell application \"System Events\" to keystroke \"[protector]\" using {}", + "timeout": null, + "stat": 0, + "out": "", + "err": "" +} +[AppleScript] Wed Jul 7 01:16:54 2021 exec + { + "code": "tell application \"System Events\" to keystroke return using {}", + "timeout": null, + "stat": 0, + "out": "", + "err": "" +} +[Info] Wed Jul 7 01:16:54 2021 unlock + { + "unlock_count": 1, + "is_lid_wake": false, + "is_idle_wake": true, + "is_sleep_wake": false, + "result": false +} +[Info] Wed Jul 7 01:16:58 2021 callback_lock_status_changed + from "True" to "False" { + "lock_by_user": false, + "unlock_by_user": false, + "is_locked": false, + "is_sleep_wake": false, + "is_lid_wake": false, + "is_idle_wake": true +} +[Info] Wed Jul 7 01:17:02 2021 t_refresh + Refresh average time (0.11008505821228028).