Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邓莹莹
backend_auto
Commits
c1e36605
Commit
c1e36605
authored
May 19, 2021
by
邓莹莹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'common_dev' of
http://git.wanmeizhensuo.com/dengyingying/backend_auto
into common_dev
parents
fb85ddaf
3ea11998
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
128 additions
and
4 deletions
+128
-4
gmai_request.py
all_backend_api/gmai_request.py
+28
-3
gmai_request.yaml
all_backend_api/gmai_request.yaml
+24
-0
path_setting.py
path_setting.py
+7
-1
test_plastic_analysis_v3.py
test_backend_case/gmai_case/test_plastic_analysis_v3.py
+17
-0
test_simulate_analyze.py
test_backend_case/gmai_case/test_simulate_analyze.py
+18
-0
plastic_analysis_v3.yaml
test_backend_data/gmai_data/plastic_analysis_v3.yaml
+17
-0
simulate_analyze.yaml
test_backend_data/gmai_data/simulate_analyze.yaml
+17
-0
No files found.
all_backend_api/gmai_request.py
View file @
c1e36605
...
@@ -21,8 +21,33 @@ class gmai_request(BaseRequest):
...
@@ -21,8 +21,33 @@ class gmai_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
"eyelids_plastic"
])
return
self
.
api_send
(
self
.
data
[
"eyelids_plastic"
])
# 模拟发型
def
simulate_analyze
(
self
,
device_id
,
image_url
,
style_id
,
type_id
):
self
.
params
[
"device_id"
]
=
device_id
self
.
params
[
"image_url"
]
=
image_url
self
.
params
[
"style_id"
]
=
style_id
self
.
params
[
"type_id"
]
=
type_id
return
self
.
api_send
(
self
.
data
[
"simulate_analyze"
])
# AI测颜值
def
plastic_analysis_v3
(
self
,
device_id
,
image_url
,
landmark
,
cheek_style_classify_id
):
self
.
params
[
"device_id"
]
=
device_id
self
.
params
[
"image_url"
]
=
image_url
self
.
params
[
"landmark"
]
=
landmark
self
.
params
[
"cheek_style_classify_id"
]
=
cheek_style_classify_id
return
self
.
api_send
(
self
.
data
[
"analysis_v3"
])
if
__name__
==
'__main__'
:
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))
# print(gmai_request().plastic_analysis_v3("869412032478155", "", "", 1))
# if __name__ == '__main__':
# print(gmai_request().skin_newReport("7.43.0","https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"))
# # print(gmai_request().skin_newReport("7.43.0","https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"))
# print(gmai_request().eyelids_plastic("7.43.0", "2021/05/12/1457/cdbe8652117d","3"))
# # print(gmai_request().eyelids_plastic("7.43.0", "2021/05/12/1457/cdbe8652117d","3"))
all_backend_api/gmai_request.yaml
View file @
c1e36605
...
@@ -15,3 +15,26 @@ eyelids_plastic:
...
@@ -15,3 +15,26 @@ eyelids_plastic:
data
:
data
:
image_url
:
${image_url}
image_url
:
${image_url}
style_id
:
${style_id}
style_id
:
${style_id}
analysis_v3
:
method
:
post
url
:
/gm_ai/plastic/analysis_v3
params
:
device_id
:
${device_id}
data
:
image_url
:
${image_url}
landmark
:
${landmark}
cheek_style_classify_id
:
${cheek_style_classify_id}
simulate_analyze
:
method
:
post
url
:
/gm_ai/simulate/analyze
params
:
device_id
:
${device_id}
data
:
image_url
:
${image_url}
style_id
:
${style_id}
type_id
:
${type_id}
\ No newline at end of file
path_setting.py
View file @
c1e36605
...
@@ -42,11 +42,17 @@ ONEIMAGE_SHARE_V4_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/
...
@@ -42,11 +42,17 @@ ONEIMAGE_SHARE_V4_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/
# 测颜值根据五官推荐美购
# 测颜值根据五官推荐美购
ONEIMAGE_RECOMEND_SERVICES_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/oneimage_data"
,
"recomend_services.yaml"
)
ONEIMAGE_RECOMEND_SERVICES_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/oneimage_data"
,
"recomend_services.yaml"
)
# 测肤结果页
# 测肤结果页
/ AI变脸结果页
GMAI_SKIN_NEWREPORT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"gmai_request.yaml"
)
GMAI_SKIN_NEWREPORT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"gmai_request.yaml"
)
GMAI_SKIN_NEWREPORT_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"skin_newReport.yaml"
)
GMAI_SKIN_NEWREPORT_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"skin_newReport.yaml"
)
# 模拟双眼皮
# 模拟双眼皮
GMAI_EYELIDS_PLASTIC_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"eyelids_plastic.yaml"
)
GMAI_EYELIDS_PLASTIC_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"eyelids_plastic.yaml"
)
# 模拟发型
GMAI_SIMULATE_ANALYZE_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"simulate_analyze.yaml"
)
# AI变脸结果
GMAI_PLASTIC_ANALYSIS_V3_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"plastic_analysis_v3.yaml"
)
LOGIN_PASSWD
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/accounts_data"
,
"login_passwd.yaml"
)
LOGIN_PASSWD
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/accounts_data"
,
"login_passwd.yaml"
)
LOGIN_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"accounts_request.yaml"
)
LOGIN_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"accounts_request.yaml"
)
...
...
test_backend_case/gmai_case/test_plastic_analysis_v3.py
0 → 100644
View file @
c1e36605
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
# AI测颜值,目前测试环境没有召回日记,先保证请求成功
class
TestPlasticnAnalysisV3
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
GMAI_PLASTIC_ANALYSIS_V3_DATA
)
plasticanalysisv3_case
,
plasticanalysisv3_data
=
get_ids
(
data
,
"analysis_v3"
)
@pytest.mark.parametrize
(
"param"
,
plasticanalysisv3_data
,
ids
=
plasticanalysisv3_case
)
def
test_plastic_analysis_v3
(
self
,
param
):
r
=
gmai_request
()
.
plastic_analysis_v3
(
param
[
"device_id"
],
param
[
"image_url"
],
param
[
"landmark"
]
,
param
[
"cheek_style_classify_id"
])
assert
r
[
"error"
]
==
0
\ No newline at end of file
test_backend_case/gmai_case/test_simulate_analyze.py
0 → 100644
View file @
c1e36605
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
# 模拟发型
class
TestSimulateAnalyze
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
GMAI_SIMULATE_ANALYZE_DATA
)
simulateanalyze_case
,
simulateanalyze_data
=
get_ids
(
data
,
"simulate_analyze"
)
@pytest.mark.parametrize
(
"param"
,
simulateanalyze_data
,
ids
=
simulateanalyze_case
)
def
test_plastic_analysis_v3
(
self
,
param
):
r
=
gmai_request
()
.
simulate_analyze
(
param
[
"device_id"
],
param
[
"image_url"
],
param
[
"style_id"
]
,
param
[
"type_id"
])
assert
r
[
"error"
]
==
0
print
(
"效果图: "
,
r
[
"data"
][
"plastic_image_url"
])
\ No newline at end of file
test_backend_data/gmai_data/plastic_analysis_v3.yaml
0 → 100644
View file @
c1e36605
analysis_v3
:
#AI测颜值
-
case
:
"
AI测颜值结果页"
device_id
:
"
869412032478155"
image_url
:
"
2021/06/01/1524/8a28dd0a3b8e"
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}]'
cheek_style_classify_id
:
"
1"
-
case
:
"
AI测颜值-上次报告页"
device_id
:
"
869412032478155"
image_url
:
"
"
landmark
:
"
"
cheek_style_classify_id
:
"
1"
\ No newline at end of file
test_backend_data/gmai_data/simulate_analyze.yaml
0 → 100644
View file @
c1e36605
simulate_analyze
:
#AI模拟发型
-
case
:
"
青春丸子头效果"
device_id
:
"
869412032478155"
image_url
:
"
2021/06/02/1456/68c702f50309"
style_id
:
3
type_id
:
7
-
case
:
"
盐系少年头效果"
device_id
:
"
869412032478155"
image_url
:
"
2021/06/02/1456/68c702f50309"
style_id
:
6
type_id
:
7
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment