Commit e437a2a6 authored by 张伟男's avatar 张伟男

AI

parent 69c73c6f
......@@ -52,14 +52,18 @@ class gmai_request(BaseRequest):
self.params["cheek_style_classify_id"] = cheek_style_classify_id
return self.api_send(self.data["plastic_analystic_v2"])
# 获取3D变脸风格参数
def plastic_cheek_style_classify(self,version):
self.params["version"] = version
return self.api_send(self.data["plastic_cheek_style_classify"])
if __name__ == '__main__':
print(gmai_request().plastic_cheek_style_classify("7.44.0"))
# landmark = '[{"x":168.96603,"y":496.76886},{"x":168.35735,"y":527.7101},{"x":169.548,"y":558.3961},{"x":171.72018,"y":588.8369},{"x":174.93307,"y":619.26794},{"x":179.31195,"y":649.03467},{"x":184.17123,"y":678.6978},{"x":191.05627,"y":707.8003},{"x":200.86497,"y":735.76196},{"x":214.62796,"y":761.79736},{"x":231.40042,"y":785.7622},{"x":250.59685,"y":807.22406},{"x":272.07196,"y":826.8049},{"x":295.4251,"y":843.86194},{"x":321.47278,"y":856.83124},{"x":349.9967,"y":864.5885},{"x":379.85767,"y":866.998},{"x":409.25287,"y":865.863},{"x":437.7829,"y":859.18054},{"x":463.35132,"y":846.88574},{"x":486.354,"y":830.38916},{"x":507.7304,"y":811.95135},{"x":527.778,"y":791.59247},{"x":545.7143,"y":769.32104},{"x":561.4353,"y":745.4949},{"x":573.70917,"y":719.9794},{"x":583.3716,"y":690.47156},{"x":591.3898,"y":660.6565},{"x":598.52515,"y":631.38513},{"x":604.5137,"y":601.75684},{"x":609.14844,"y":572.0621},{"x":612.0713,"y":541.85956},{"x":613.5779,"y":511.5329},{"x":203.42625,"y":444.83066},{"x":229.21182,"y":410.30188},{"x":270.9198,"y":399.64984},{"x":313.56497,"y":407.32513},{"x":354.0185,"y":422.54175},{"x":441.31384,"y":427.71216},{"x":482.0569,"y":416.21152},{"x":524.1508,"y":412.38593},{"x":563.6658,"y":426.22824},{"x":585.87964,"y":462.41913},{"x":394.46844,"y":504.41254},{"x":393.96762,"y":546.5007},{"x":393.30322,"y":588.8532},{"x":392.592,"y":631.0979},{"x":342.77267,"y":664.1739},{"x":364.95947,"y":668.7595},{"x":390.1893,"y":673.2006},{"x":415.25336,"y":670.5106},{"x":436.7552,"y":666.998},{"x":242.81853,"y":506.60803},{"x":262.98138,"y":497.55713},{"x":305.08954,"y":499.77777},{"x":321.22906,"y":513.3391},{"x":301.56146,"y":521.4862},{"x":260.00668,"y":519.3686},{"x":462.97388,"y":517.84485},{"x":480.18396,"y":505.8437},{"x":522.09973,"y":506.45386},{"x":540.26013,"y":517.4052},{"x":523.0011,"y":528.3126},{"x":482.06146,"y":527.1489},{"x":239.75659,"y":436.6534},{"x":277.67075,"y":433.85788},{"x":315.04602,"y":438.8376},{"x":351.56638,"y":447.66888},{"x":441.58453,"y":452.58017},{"x":477.96664,"y":447.28973},{"x":515.05225,"y":445.83618},{"x":551.5746,"y":451.62656},{"x":284.38373,"y":496.0074},{"x":280.49805,"y":523.8891},{"x":284.44955,"y":508.43988},{"x":501.19617,"y":503.6411},{"x":502.51047,"y":530.9885},{"x":501.47836,"y":515.5879},{"x":357.51913,"y":508.84628},{"x":428.91504,"y":511.1767},{"x":341.02893,"y":607.7458},{"x":442.021,"y":610.8187},{"x":324.796,"y":641.13324},{"x":456.35925,"y":645.5844},{"x":304.6747,"y":728.90186},{"x":334.5838,"y":715.599},{"x":369.0162,"y":710.4512},{"x":390.31683,"y":714.9321},{"x":411.64032,"y":711.3696},{"x":445.83594,"y":718.7887},{"x":474.80075,"y":735.1745},{"x":451.05292,"y":753.0734},{"x":421.3767,"y":761.7219},{"x":390.41638,"y":763.2075},{"x":358.4326,"y":759.44385},{"x":328.53287,"y":748.5295},{"x":311.38818,"y":729.83777},{"x":350.23193,"y":734.1919},{"x":390.38123,"y":737.72284},{"x":429.7071,"y":736.18054},{"x":468.49692,"y":735.4535},{"x":430.71494,"y":739.61053},{"x":391.11005,"y":741.01697},{"x":349.98578,"y":737.08875},{"x":284.5382,"y":508.54742},{"x":501.50644,"y":515.53107}]'
# print(gmai_request().plastic_analystic_v2("869412032478155", "2021/06/01/1524/8a28dd0a3b8e",landmark,1))
# print(gmai_request().simulate_conf("-1"))
print(gmai_request().simulate_analyze("869412032478155","2021/06/02/1456/68c702f50309","3","7"))
# print(gmai_request().simulate_analyze("869412032478155","2021/06/02/1456/68c702f50309","3","7"))
# landmark = '[{"x":248.60858,"y":454.0434},{"x":247.92863,"y":476.7021},{"x":248.8779,"y":499.36874},{"x":251.12755,"y":521.8638},{"x":254.58401,"y":544.24164},{"x":259.10333,"y":566.1669},{"x":264.02515,"y":588.0588},{"x":270.59506,"y":609.44214},{"x":279.6361,"y":629.6998},{"x":291.60773,"y":648.29407},{"x":305.6806,"y":665.26465},{"x":321.33615,"y":680.4736},{"x":338.2943,"y":694.64526},{"x":356.13144,"y":707.5386},{"x":375.71283,"y":717.8617},{"x":397.27545,"y":724.19965},{"x":419.9613,"y":726.1914},{"x":441.62817,"y":725.2733},{"x":462.6242,"y":719.917},{"x":481.41635,"y":710.3818},{"x":498.45187,"y":697.98035},{"x":514.59436,"y":684.40234},{"x":529.7782,"y":669.4685},{"x":543.08704,"y":653.1195},{"x":554.60706,"y":635.73456},{"x":563.3266,"y":617.3142},{"x":570.0075,"y":596.0911},{"x":575.7123,"y":574.78046},{"x":581.05774,"y":554.0385},{"x":585.48157,"y":533.1105},{"x":588.66907,"y":512.06683},{"x":590.4706,"y":490.68823},{"x":591.2653,"y":469.50403},{"x":279.37485,"y":410.2143},{"x":299.98352,"y":383.6742},{"x":331.64465,"y":375.0197},{"x":364.35858,"y":381.4741},{"x":395.4406,"y":394.20447},{"x":466.45248,"y":397.95},{"x":496.4015,"y":389.2094},{"x":527.33295,"y":386.7473},{"x":555.7313,"y":398.20285},{"x":571.48254,"y":425.62354},{"x":427.4568,"y":456.95285},{"x":426.77496,"y":483.84033},{"x":426.04883,"y":510.83325},{"x":425.32236,"y":537.75256},{"x":385.83856,"y":572.9858},{"x":403.71045,"y":573.0551},{"x":423.23145,"y":574.53534},{"x":442.28857,"y":574.4508},{"x":459.13876,"y":574.9396},{"x":307.80756,"y":458.6329},{"x":323.8154,"y":450.41855},{"x":359.07312,"y":453.8022},{"x":371.75238,"y":466.2728},{"x":355.36838,"y":470.9956},{"x":321.71375,"y":468.2021},{"x":479.14362,"y":470.68353},{"x":492.57837,"y":459.77023},{"x":526.78955,"y":459.34094},{"x":540.76917,"y":469.22626},{"x":526.91675,"y":477.2774},{"x":494.3828,"y":476.6469},{"x":307.39963,"y":402.42038},{"x":336.54358,"y":400.2494},{"x":365.31128,"y":405.05597},{"x":393.4093,"y":412.95276},{"x":466.55408,"y":416.23398},{"x":493.2259,"y":412.04782},{"x":520.28235,"y":410.81372},{"x":546.7446,"y":415.7663},{"x":341.78073,"y":449.21838},{"x":338.20166,"y":471.98853},{"x":342.39044,"y":460.15692},{"x":509.66327,"y":456.7909},{"x":510.57373,"y":479.22314},{"x":508.77704,"y":467.26038},{"x":399.44565,"y":461.61548},{"x":453.4572,"y":463.86423},{"x":384.4139,"y":527.5456},{"x":463.68613,"y":530.3157},{"x":369.6485,"y":554.5674},{"x":475.98178,"y":558.04224},{"x":358.72372,"y":632.25916},{"x":379.92645,"y":612.99927},{"x":406.5278,"y":600.8932},{"x":422.78525,"y":604.4064},{"x":439.0467,"y":601.5054},{"x":463.0918,"y":613.59924},{"x":480.34888,"y":633.28406},{"x":463.28207,"y":645.23676},{"x":442.62195,"y":651.3627},{"x":420.9704,"y":652.71295},{"x":398.036,"y":651.2082},{"x":376.4565,"y":644.82745},{"x":363.59555,"y":631.5963},{"x":392.39032,"y":626.09314},{"x":422.20786,"y":626.16754},{"x":449.31833,"y":626.3133},{"x":475.72333,"y":632.3503},{"x":448.87988,"y":625.9888},{"x":421.7511,"y":626.1827},{"x":392.28534,"y":625.9193},{"x":342.4176,"y":460.03064},{"x":508.8405,"y":467.07236}]'
# 测颜值和 上次结果
# print(gmai_request().plastic_analysis_v3("869412032478155", "2021/06/01/1524/8a28dd0a3b8e",landmark,1))
......
......@@ -56,4 +56,11 @@ plastic_analystic_v2:
data:
image_url: ${image_url}
landmark: ${landmark}
cheek_style_classify_id: ${cheek_style_classify_id}
\ No newline at end of file
cheek_style_classify_id: ${cheek_style_classify_id}
plastic_cheek_style_classify:
method: get
url: /gm_ai/plastic/cheek_style_classify
params:
version: ${version}
\ No newline at end of file
......@@ -98,6 +98,8 @@ EYELIDS_DIARY_CARDS_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_dat
# AI变脸结果
GMAI_PLASTIC_ANALYSIS_V3_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_analysis_v3.yaml")
# 3D变脸获取参数
GMAI_PLASTIC_CHECCK_STYLE_CLASSTIFY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_cheek_style_classify.yaml")
# 3D变脸
GMAI_PLASTIC_ANALYSIS_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_analysis_v2.yaml")
# 新版本我的美券列表
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.gmai_request import gmai_request
# 3D变脸
class TestPlasticChecckStyleClasstify:
data = BaseRequest().api_load(path_setting.GMAI_PLASTIC_CHECCK_STYLE_CLASSTIFY_DATA)
plasticchecckstyleclasstify_case, plasticchecckstyleclasstify_data = get_ids(data, "plastic_cheek_style_classify")
@pytest.mark.parametrize("param",plasticchecckstyleclasstify_data,ids=plasticchecckstyleclasstify_case)
def test_plastic_cheek_style_classify(self,param):
r = gmai_request().plastic_cheek_style_classify(param["version"])
if r["error"] == 0:
classifies = r["data"]["classifies"]
assert len(classifies) > param["assert"]
plastic_cheek_style_classify:
#获取3D变脸配置
-
case: "获取3D变脸配置"
version: "7.44.0"
assert: 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment