tccli 3.0.1352.1__py2.py3-none-any.whl → 3.0.1354.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tccli/__init__.py +1 -1
- tccli/services/aiart/aiart_client.py +70 -123
- tccli/services/aiart/v20221229/api.json +3 -101
- tccli/services/aiart/v20221229/examples.json +0 -8
- tccli/services/apm/v20210622/api.json +2 -2
- tccli/services/cbs/v20170312/examples.json +3 -3
- tccli/services/ccc/v20200210/api.json +10 -0
- tccli/services/cdb/v20170320/api.json +64 -16
- tccli/services/cdb/v20170320/examples.json +1 -1
- tccli/services/cdn/v20180606/api.json +0 -3
- tccli/services/cdn/v20180606/examples.json +2 -2
- tccli/services/cfg/v20210820/api.json +11 -0
- tccli/services/cfs/v20190719/api.json +46 -0
- tccli/services/csip/v20221121/api.json +21 -3
- tccli/services/csip/v20221121/examples.json +1 -1
- tccli/services/dbbrain/v20210527/api.json +40 -0
- tccli/services/dlc/dlc_client.py +53 -0
- tccli/services/dlc/v20210125/api.json +44 -0
- tccli/services/dlc/v20210125/examples.json +8 -0
- tccli/services/eb/v20210416/api.json +17 -8
- tccli/services/eb/v20210416/examples.json +1 -1
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/gs/v20191118/api.json +32 -2
- tccli/services/iai/v20180301/api.json +143 -135
- tccli/services/iai/v20180301/examples.json +18 -12
- tccli/services/iai/v20200303/api.json +4 -4
- tccli/services/igtm/v20231024/api.json +239 -239
- tccli/services/igtm/v20231024/examples.json +6 -6
- tccli/services/iotvideo/v20191126/api.json +1 -1
- tccli/services/iotvideo/v20201215/api.json +1 -1
- tccli/services/iotvideo/v20211125/api.json +1 -1
- tccli/services/lighthouse/v20200324/api.json +10 -0
- tccli/services/lke/v20231130/api.json +2 -2
- tccli/services/lkeap/v20240522/api.json +3 -3
- tccli/services/monitor/v20180724/api.json +7 -7
- tccli/services/monitor/v20180724/examples.json +2 -2
- tccli/services/tcbr/v20220217/api.json +10 -0
- tccli/services/tke/v20180525/api.json +49 -1
- tccli/services/trro/v20220325/api.json +1 -1
- tccli/services/trtc/trtc_client.py +459 -35
- tccli/services/trtc/v20190722/api.json +1069 -82
- tccli/services/trtc/v20190722/examples.json +64 -0
- tccli/services/tts/v20190823/api.json +1 -1
- tccli/services/vod/v20180717/api.json +11 -2
- tccli/services/vod/v20180717/examples.json +17 -17
- tccli/services/wedata/v20210820/api.json +501 -3
- tccli/services/wedata/v20210820/examples.json +86 -0
- tccli/services/wedata/wedata_client.py +440 -69
- {tccli-3.0.1352.1.dist-info → tccli-3.0.1354.1.dist-info}/METADATA +3 -3
- {tccli-3.0.1352.1.dist-info → tccli-3.0.1354.1.dist-info}/RECORD +53 -53
- {tccli-3.0.1352.1.dist-info → tccli-3.0.1354.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1352.1.dist-info → tccli-3.0.1354.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1352.1.dist-info → tccli-3.0.1354.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1354.1'
|
@@ -17,59 +17,7 @@ from tencentcloud.aiart.v20221229 import models as models_v20221229
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def
|
21
|
-
g_param = parse_global_arg(parsed_globals)
|
22
|
-
|
23
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
24
|
-
cred = credential.CVMRoleCredential()
|
25
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
26
|
-
cred = credential.STSAssumeRoleCredential(
|
27
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
28
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
29
|
-
)
|
30
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
31
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
32
|
-
else:
|
33
|
-
cred = credential.Credential(
|
34
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
35
|
-
)
|
36
|
-
http_profile = HttpProfile(
|
37
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
38
|
-
reqMethod="POST",
|
39
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
40
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
41
|
-
)
|
42
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
43
|
-
if g_param[OptionsDefine.Language]:
|
44
|
-
profile.language = g_param[OptionsDefine.Language]
|
45
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
46
|
-
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.ReplaceBackgroundRequest()
|
50
|
-
model.from_json_string(json.dumps(args))
|
51
|
-
start_time = time.time()
|
52
|
-
while True:
|
53
|
-
rsp = client.ReplaceBackground(model)
|
54
|
-
result = rsp.to_json_string()
|
55
|
-
try:
|
56
|
-
json_obj = json.loads(result)
|
57
|
-
except TypeError as e:
|
58
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
59
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
60
|
-
break
|
61
|
-
cur_time = time.time()
|
62
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
63
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
64
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
65
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
66
|
-
else:
|
67
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
68
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
69
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
|
-
|
71
|
-
|
72
|
-
def doSubmitTrainPortraitModelJob(args, parsed_globals):
|
20
|
+
def doSubmitMemeJob(args, parsed_globals):
|
73
21
|
g_param = parse_global_arg(parsed_globals)
|
74
22
|
|
75
23
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -98,11 +46,11 @@ def doSubmitTrainPortraitModelJob(args, parsed_globals):
|
|
98
46
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
99
47
|
client._sdkVersion += ("_CLI_" + __version__)
|
100
48
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.
|
49
|
+
model = models.SubmitMemeJobRequest()
|
102
50
|
model.from_json_string(json.dumps(args))
|
103
51
|
start_time = time.time()
|
104
52
|
while True:
|
105
|
-
rsp = client.
|
53
|
+
rsp = client.SubmitMemeJob(model)
|
106
54
|
result = rsp.to_json_string()
|
107
55
|
try:
|
108
56
|
json_obj = json.loads(result)
|
@@ -121,7 +69,7 @@ def doSubmitTrainPortraitModelJob(args, parsed_globals):
|
|
121
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
70
|
|
123
71
|
|
124
|
-
def
|
72
|
+
def doRefineImage(args, parsed_globals):
|
125
73
|
g_param = parse_global_arg(parsed_globals)
|
126
74
|
|
127
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +98,11 @@ def doTextToImage(args, parsed_globals):
|
|
150
98
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
151
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
101
|
+
model = models.RefineImageRequest()
|
154
102
|
model.from_json_string(json.dumps(args))
|
155
103
|
start_time = time.time()
|
156
104
|
while True:
|
157
|
-
rsp = client.
|
105
|
+
rsp = client.RefineImage(model)
|
158
106
|
result = rsp.to_json_string()
|
159
107
|
try:
|
160
108
|
json_obj = json.loads(result)
|
@@ -173,7 +121,7 @@ def doTextToImage(args, parsed_globals):
|
|
173
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
122
|
|
175
123
|
|
176
|
-
def
|
124
|
+
def doSketchToImage(args, parsed_globals):
|
177
125
|
g_param = parse_global_arg(parsed_globals)
|
178
126
|
|
179
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -202,11 +150,11 @@ def doSubmitDrawPortraitJob(args, parsed_globals):
|
|
202
150
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
203
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
204
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.
|
153
|
+
model = models.SketchToImageRequest()
|
206
154
|
model.from_json_string(json.dumps(args))
|
207
155
|
start_time = time.time()
|
208
156
|
while True:
|
209
|
-
rsp = client.
|
157
|
+
rsp = client.SketchToImage(model)
|
210
158
|
result = rsp.to_json_string()
|
211
159
|
try:
|
212
160
|
json_obj = json.loads(result)
|
@@ -225,7 +173,7 @@ def doSubmitDrawPortraitJob(args, parsed_globals):
|
|
225
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
174
|
|
227
175
|
|
228
|
-
def
|
176
|
+
def doSubmitTextToImageProJob(args, parsed_globals):
|
229
177
|
g_param = parse_global_arg(parsed_globals)
|
230
178
|
|
231
179
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +202,11 @@ def doImageToImage(args, parsed_globals):
|
|
254
202
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
255
203
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
204
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
205
|
+
model = models.SubmitTextToImageProJobRequest()
|
258
206
|
model.from_json_string(json.dumps(args))
|
259
207
|
start_time = time.time()
|
260
208
|
while True:
|
261
|
-
rsp = client.
|
209
|
+
rsp = client.SubmitTextToImageProJob(model)
|
262
210
|
result = rsp.to_json_string()
|
263
211
|
try:
|
264
212
|
json_obj = json.loads(result)
|
@@ -277,7 +225,7 @@ def doImageToImage(args, parsed_globals):
|
|
277
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
226
|
|
279
227
|
|
280
|
-
def
|
228
|
+
def doReplaceBackground(args, parsed_globals):
|
281
229
|
g_param = parse_global_arg(parsed_globals)
|
282
230
|
|
283
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +254,11 @@ def doRefineImage(args, parsed_globals):
|
|
306
254
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
307
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
257
|
+
model = models.ReplaceBackgroundRequest()
|
310
258
|
model.from_json_string(json.dumps(args))
|
311
259
|
start_time = time.time()
|
312
260
|
while True:
|
313
|
-
rsp = client.
|
261
|
+
rsp = client.ReplaceBackground(model)
|
314
262
|
result = rsp.to_json_string()
|
315
263
|
try:
|
316
264
|
json_obj = json.loads(result)
|
@@ -329,7 +277,7 @@ def doRefineImage(args, parsed_globals):
|
|
329
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
278
|
|
331
279
|
|
332
|
-
def
|
280
|
+
def doTextToImageRapid(args, parsed_globals):
|
333
281
|
g_param = parse_global_arg(parsed_globals)
|
334
282
|
|
335
283
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -358,11 +306,11 @@ def doImageOutpainting(args, parsed_globals):
|
|
358
306
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
359
307
|
client._sdkVersion += ("_CLI_" + __version__)
|
360
308
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.
|
309
|
+
model = models.TextToImageRapidRequest()
|
362
310
|
model.from_json_string(json.dumps(args))
|
363
311
|
start_time = time.time()
|
364
312
|
while True:
|
365
|
-
rsp = client.
|
313
|
+
rsp = client.TextToImageRapid(model)
|
366
314
|
result = rsp.to_json_string()
|
367
315
|
try:
|
368
316
|
json_obj = json.loads(result)
|
@@ -381,7 +329,7 @@ def doImageOutpainting(args, parsed_globals):
|
|
381
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
382
330
|
|
383
331
|
|
384
|
-
def
|
332
|
+
def doSubmitTrainPortraitModelJob(args, parsed_globals):
|
385
333
|
g_param = parse_global_arg(parsed_globals)
|
386
334
|
|
387
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -410,11 +358,11 @@ def doGenerateAvatar(args, parsed_globals):
|
|
410
358
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
411
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
412
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
-
model = models.
|
361
|
+
model = models.SubmitTrainPortraitModelJobRequest()
|
414
362
|
model.from_json_string(json.dumps(args))
|
415
363
|
start_time = time.time()
|
416
364
|
while True:
|
417
|
-
rsp = client.
|
365
|
+
rsp = client.SubmitTrainPortraitModelJob(model)
|
418
366
|
result = rsp.to_json_string()
|
419
367
|
try:
|
420
368
|
json_obj = json.loads(result)
|
@@ -433,7 +381,7 @@ def doGenerateAvatar(args, parsed_globals):
|
|
433
381
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
382
|
|
435
383
|
|
436
|
-
def
|
384
|
+
def doImageOutpainting(args, parsed_globals):
|
437
385
|
g_param = parse_global_arg(parsed_globals)
|
438
386
|
|
439
387
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +410,11 @@ def doSubmitMemeJob(args, parsed_globals):
|
|
462
410
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
463
411
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
412
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
413
|
+
model = models.ImageOutpaintingRequest()
|
466
414
|
model.from_json_string(json.dumps(args))
|
467
415
|
start_time = time.time()
|
468
416
|
while True:
|
469
|
-
rsp = client.
|
417
|
+
rsp = client.ImageOutpainting(model)
|
470
418
|
result = rsp.to_json_string()
|
471
419
|
try:
|
472
420
|
json_obj = json.loads(result)
|
@@ -485,7 +433,7 @@ def doSubmitMemeJob(args, parsed_globals):
|
|
485
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
434
|
|
487
435
|
|
488
|
-
def
|
436
|
+
def doGenerateAvatar(args, parsed_globals):
|
489
437
|
g_param = parse_global_arg(parsed_globals)
|
490
438
|
|
491
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -514,11 +462,11 @@ def doSketchToImage(args, parsed_globals):
|
|
514
462
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
515
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
516
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.
|
465
|
+
model = models.GenerateAvatarRequest()
|
518
466
|
model.from_json_string(json.dumps(args))
|
519
467
|
start_time = time.time()
|
520
468
|
while True:
|
521
|
-
rsp = client.
|
469
|
+
rsp = client.GenerateAvatar(model)
|
522
470
|
result = rsp.to_json_string()
|
523
471
|
try:
|
524
472
|
json_obj = json.loads(result)
|
@@ -537,7 +485,7 @@ def doSketchToImage(args, parsed_globals):
|
|
537
485
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
486
|
|
539
487
|
|
540
|
-
def
|
488
|
+
def doQueryMemeJob(args, parsed_globals):
|
541
489
|
g_param = parse_global_arg(parsed_globals)
|
542
490
|
|
543
491
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -566,11 +514,11 @@ def doQueryTextToImageProJob(args, parsed_globals):
|
|
566
514
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
567
515
|
client._sdkVersion += ("_CLI_" + __version__)
|
568
516
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
-
model = models.
|
517
|
+
model = models.QueryMemeJobRequest()
|
570
518
|
model.from_json_string(json.dumps(args))
|
571
519
|
start_time = time.time()
|
572
520
|
while True:
|
573
|
-
rsp = client.
|
521
|
+
rsp = client.QueryMemeJob(model)
|
574
522
|
result = rsp.to_json_string()
|
575
523
|
try:
|
576
524
|
json_obj = json.loads(result)
|
@@ -589,7 +537,7 @@ def doQueryTextToImageProJob(args, parsed_globals):
|
|
589
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
538
|
|
591
539
|
|
592
|
-
def
|
540
|
+
def doQueryTrainPortraitModelJob(args, parsed_globals):
|
593
541
|
g_param = parse_global_arg(parsed_globals)
|
594
542
|
|
595
543
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -618,11 +566,11 @@ def doQueryMemeJob(args, parsed_globals):
|
|
618
566
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
619
567
|
client._sdkVersion += ("_CLI_" + __version__)
|
620
568
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
-
model = models.
|
569
|
+
model = models.QueryTrainPortraitModelJobRequest()
|
622
570
|
model.from_json_string(json.dumps(args))
|
623
571
|
start_time = time.time()
|
624
572
|
while True:
|
625
|
-
rsp = client.
|
573
|
+
rsp = client.QueryTrainPortraitModelJob(model)
|
626
574
|
result = rsp.to_json_string()
|
627
575
|
try:
|
628
576
|
json_obj = json.loads(result)
|
@@ -641,7 +589,7 @@ def doQueryMemeJob(args, parsed_globals):
|
|
641
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
590
|
|
643
591
|
|
644
|
-
def
|
592
|
+
def doQueryDrawPortraitJob(args, parsed_globals):
|
645
593
|
g_param = parse_global_arg(parsed_globals)
|
646
594
|
|
647
595
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -670,11 +618,11 @@ def doQueryTrainPortraitModelJob(args, parsed_globals):
|
|
670
618
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
671
619
|
client._sdkVersion += ("_CLI_" + __version__)
|
672
620
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
-
model = models.
|
621
|
+
model = models.QueryDrawPortraitJobRequest()
|
674
622
|
model.from_json_string(json.dumps(args))
|
675
623
|
start_time = time.time()
|
676
624
|
while True:
|
677
|
-
rsp = client.
|
625
|
+
rsp = client.QueryDrawPortraitJob(model)
|
678
626
|
result = rsp.to_json_string()
|
679
627
|
try:
|
680
628
|
json_obj = json.loads(result)
|
@@ -745,7 +693,7 @@ def doQueryGlamPicJob(args, parsed_globals):
|
|
745
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
694
|
|
747
695
|
|
748
|
-
def
|
696
|
+
def doUploadTrainPortraitImages(args, parsed_globals):
|
749
697
|
g_param = parse_global_arg(parsed_globals)
|
750
698
|
|
751
699
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -774,11 +722,11 @@ def doImageInpaintingRemoval(args, parsed_globals):
|
|
774
722
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
775
723
|
client._sdkVersion += ("_CLI_" + __version__)
|
776
724
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.
|
725
|
+
model = models.UploadTrainPortraitImagesRequest()
|
778
726
|
model.from_json_string(json.dumps(args))
|
779
727
|
start_time = time.time()
|
780
728
|
while True:
|
781
|
-
rsp = client.
|
729
|
+
rsp = client.UploadTrainPortraitImages(model)
|
782
730
|
result = rsp.to_json_string()
|
783
731
|
try:
|
784
732
|
json_obj = json.loads(result)
|
@@ -797,7 +745,7 @@ def doImageInpaintingRemoval(args, parsed_globals):
|
|
797
745
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
746
|
|
799
747
|
|
800
|
-
def
|
748
|
+
def doQueryTextToImageProJob(args, parsed_globals):
|
801
749
|
g_param = parse_global_arg(parsed_globals)
|
802
750
|
|
803
751
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +774,11 @@ def doTextToImageRapid(args, parsed_globals):
|
|
826
774
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
827
775
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
776
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
777
|
+
model = models.QueryTextToImageProJobRequest()
|
830
778
|
model.from_json_string(json.dumps(args))
|
831
779
|
start_time = time.time()
|
832
780
|
while True:
|
833
|
-
rsp = client.
|
781
|
+
rsp = client.QueryTextToImageProJob(model)
|
834
782
|
result = rsp.to_json_string()
|
835
783
|
try:
|
836
784
|
json_obj = json.loads(result)
|
@@ -849,7 +797,7 @@ def doTextToImageRapid(args, parsed_globals):
|
|
849
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
798
|
|
851
799
|
|
852
|
-
def
|
800
|
+
def doSubmitGlamPicJob(args, parsed_globals):
|
853
801
|
g_param = parse_global_arg(parsed_globals)
|
854
802
|
|
855
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -878,11 +826,11 @@ def doSubmitTextToImageProJob(args, parsed_globals):
|
|
878
826
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
879
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
880
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.
|
829
|
+
model = models.SubmitGlamPicJobRequest()
|
882
830
|
model.from_json_string(json.dumps(args))
|
883
831
|
start_time = time.time()
|
884
832
|
while True:
|
885
|
-
rsp = client.
|
833
|
+
rsp = client.SubmitGlamPicJob(model)
|
886
834
|
result = rsp.to_json_string()
|
887
835
|
try:
|
888
836
|
json_obj = json.loads(result)
|
@@ -901,7 +849,7 @@ def doSubmitTextToImageProJob(args, parsed_globals):
|
|
901
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
850
|
|
903
851
|
|
904
|
-
def
|
852
|
+
def doChangeClothes(args, parsed_globals):
|
905
853
|
g_param = parse_global_arg(parsed_globals)
|
906
854
|
|
907
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -930,11 +878,11 @@ def doUploadTrainPortraitImages(args, parsed_globals):
|
|
930
878
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
931
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
932
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.
|
881
|
+
model = models.ChangeClothesRequest()
|
934
882
|
model.from_json_string(json.dumps(args))
|
935
883
|
start_time = time.time()
|
936
884
|
while True:
|
937
|
-
rsp = client.
|
885
|
+
rsp = client.ChangeClothes(model)
|
938
886
|
result = rsp.to_json_string()
|
939
887
|
try:
|
940
888
|
json_obj = json.loads(result)
|
@@ -953,7 +901,7 @@ def doUploadTrainPortraitImages(args, parsed_globals):
|
|
953
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
902
|
|
955
903
|
|
956
|
-
def
|
904
|
+
def doImageInpaintingRemoval(args, parsed_globals):
|
957
905
|
g_param = parse_global_arg(parsed_globals)
|
958
906
|
|
959
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -982,11 +930,11 @@ def doQueryDrawPortraitJob(args, parsed_globals):
|
|
982
930
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
983
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
984
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.
|
933
|
+
model = models.ImageInpaintingRemovalRequest()
|
986
934
|
model.from_json_string(json.dumps(args))
|
987
935
|
start_time = time.time()
|
988
936
|
while True:
|
989
|
-
rsp = client.
|
937
|
+
rsp = client.ImageInpaintingRemoval(model)
|
990
938
|
result = rsp.to_json_string()
|
991
939
|
try:
|
992
940
|
json_obj = json.loads(result)
|
@@ -1005,7 +953,7 @@ def doQueryDrawPortraitJob(args, parsed_globals):
|
|
1005
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
954
|
|
1007
955
|
|
1008
|
-
def
|
956
|
+
def doSubmitDrawPortraitJob(args, parsed_globals):
|
1009
957
|
g_param = parse_global_arg(parsed_globals)
|
1010
958
|
|
1011
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1034,11 +982,11 @@ def doSubmitGlamPicJob(args, parsed_globals):
|
|
1034
982
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
1036
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.
|
985
|
+
model = models.SubmitDrawPortraitJobRequest()
|
1038
986
|
model.from_json_string(json.dumps(args))
|
1039
987
|
start_time = time.time()
|
1040
988
|
while True:
|
1041
|
-
rsp = client.
|
989
|
+
rsp = client.SubmitDrawPortraitJob(model)
|
1042
990
|
result = rsp.to_json_string()
|
1043
991
|
try:
|
1044
992
|
json_obj = json.loads(result)
|
@@ -1057,7 +1005,7 @@ def doSubmitGlamPicJob(args, parsed_globals):
|
|
1057
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1006
|
|
1059
1007
|
|
1060
|
-
def
|
1008
|
+
def doTextToImageLite(args, parsed_globals):
|
1061
1009
|
g_param = parse_global_arg(parsed_globals)
|
1062
1010
|
|
1063
1011
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1034,11 @@ def doChangeClothes(args, parsed_globals):
|
|
1086
1034
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1035
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1036
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1037
|
+
model = models.TextToImageLiteRequest()
|
1090
1038
|
model.from_json_string(json.dumps(args))
|
1091
1039
|
start_time = time.time()
|
1092
1040
|
while True:
|
1093
|
-
rsp = client.
|
1041
|
+
rsp = client.TextToImageLite(model)
|
1094
1042
|
result = rsp.to_json_string()
|
1095
1043
|
try:
|
1096
1044
|
json_obj = json.loads(result)
|
@@ -1109,7 +1057,7 @@ def doChangeClothes(args, parsed_globals):
|
|
1109
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
1058
|
|
1111
1059
|
|
1112
|
-
def
|
1060
|
+
def doImageToImage(args, parsed_globals):
|
1113
1061
|
g_param = parse_global_arg(parsed_globals)
|
1114
1062
|
|
1115
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1138,11 +1086,11 @@ def doTextToImageLite(args, parsed_globals):
|
|
1138
1086
|
client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
1140
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
-
model = models.
|
1089
|
+
model = models.ImageToImageRequest()
|
1142
1090
|
model.from_json_string(json.dumps(args))
|
1143
1091
|
start_time = time.time()
|
1144
1092
|
while True:
|
1145
|
-
rsp = client.
|
1093
|
+
rsp = client.ImageToImage(model)
|
1146
1094
|
result = rsp.to_json_string()
|
1147
1095
|
try:
|
1148
1096
|
json_obj = json.loads(result)
|
@@ -1172,28 +1120,27 @@ MODELS_MAP = {
|
|
1172
1120
|
}
|
1173
1121
|
|
1174
1122
|
ACTION_MAP = {
|
1123
|
+
"SubmitMemeJob": doSubmitMemeJob,
|
1124
|
+
"RefineImage": doRefineImage,
|
1125
|
+
"SketchToImage": doSketchToImage,
|
1126
|
+
"SubmitTextToImageProJob": doSubmitTextToImageProJob,
|
1175
1127
|
"ReplaceBackground": doReplaceBackground,
|
1128
|
+
"TextToImageRapid": doTextToImageRapid,
|
1176
1129
|
"SubmitTrainPortraitModelJob": doSubmitTrainPortraitModelJob,
|
1177
|
-
"TextToImage": doTextToImage,
|
1178
|
-
"SubmitDrawPortraitJob": doSubmitDrawPortraitJob,
|
1179
|
-
"ImageToImage": doImageToImage,
|
1180
|
-
"RefineImage": doRefineImage,
|
1181
1130
|
"ImageOutpainting": doImageOutpainting,
|
1182
1131
|
"GenerateAvatar": doGenerateAvatar,
|
1183
|
-
"SubmitMemeJob": doSubmitMemeJob,
|
1184
|
-
"SketchToImage": doSketchToImage,
|
1185
|
-
"QueryTextToImageProJob": doQueryTextToImageProJob,
|
1186
1132
|
"QueryMemeJob": doQueryMemeJob,
|
1187
1133
|
"QueryTrainPortraitModelJob": doQueryTrainPortraitModelJob,
|
1134
|
+
"QueryDrawPortraitJob": doQueryDrawPortraitJob,
|
1188
1135
|
"QueryGlamPicJob": doQueryGlamPicJob,
|
1189
|
-
"ImageInpaintingRemoval": doImageInpaintingRemoval,
|
1190
|
-
"TextToImageRapid": doTextToImageRapid,
|
1191
|
-
"SubmitTextToImageProJob": doSubmitTextToImageProJob,
|
1192
1136
|
"UploadTrainPortraitImages": doUploadTrainPortraitImages,
|
1193
|
-
"
|
1137
|
+
"QueryTextToImageProJob": doQueryTextToImageProJob,
|
1194
1138
|
"SubmitGlamPicJob": doSubmitGlamPicJob,
|
1195
1139
|
"ChangeClothes": doChangeClothes,
|
1140
|
+
"ImageInpaintingRemoval": doImageInpaintingRemoval,
|
1141
|
+
"SubmitDrawPortraitJob": doSubmitDrawPortraitJob,
|
1196
1142
|
"TextToImageLite": doTextToImageLite,
|
1143
|
+
"ImageToImage": doImageToImage,
|
1197
1144
|
|
1198
1145
|
}
|
1199
1146
|
|