tencentcloud-sdk-python-ocr 3.1.127__py2.py3-none-any.whl → 3.1.130__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.
- tencentcloud/__init__.py +1 -1
- tencentcloud/ocr/v20181119/models.py +427 -4
- tencentcloud/ocr/v20181119/ocr_client.py +50 -0
- tencentcloud/ocr/v20181119/ocr_client_async.py +40 -0
- {tencentcloud_sdk_python_ocr-3.1.127.dist-info → tencentcloud_sdk_python_ocr-3.1.130.dist-info}/METADATA +2 -2
- tencentcloud_sdk_python_ocr-3.1.130.dist-info/RECORD +11 -0
- tencentcloud_sdk_python_ocr-3.1.127.dist-info/RECORD +0 -11
- {tencentcloud_sdk_python_ocr-3.1.127.dist-info → tencentcloud_sdk_python_ocr-3.1.130.dist-info}/WHEEL +0 -0
- {tencentcloud_sdk_python_ocr-3.1.127.dist-info → tencentcloud_sdk_python_ocr-3.1.130.dist-info}/top_level.txt +0 -0
tencentcloud/__init__.py
CHANGED
|
@@ -4405,6 +4405,252 @@ class CoordList(AbstractModel):
|
|
|
4405
4405
|
|
|
4406
4406
|
|
|
4407
4407
|
|
|
4408
|
+
class CropEnhanceImageOCRRequest(AbstractModel):
|
|
4409
|
+
r"""CropEnhanceImageOCR请求参数结构体
|
|
4410
|
+
|
|
4411
|
+
"""
|
|
4412
|
+
|
|
4413
|
+
def __init__(self):
|
|
4414
|
+
r"""
|
|
4415
|
+
:param _ImageBase64: <p>图片/PDF的 Base64 值。要求Base64不超过10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。</p>
|
|
4416
|
+
:type ImageBase64: str
|
|
4417
|
+
:param _ImageUrl: <p>图片/PDF的 Url 地址。要求图片经Base64编码后不超过10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。图片下载时间不超过 3 秒。图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。</p>
|
|
4418
|
+
:type ImageUrl: str
|
|
4419
|
+
:param _PdfPageNumber: <p>需要识别的PDF页面的对应页码,仅支持PDF单页识别,默认值为1。</p>
|
|
4420
|
+
:type PdfPageNumber: int
|
|
4421
|
+
:param _Crop: <p>0表示关闭切边<br>1表示开启切边,默认为1</p>
|
|
4422
|
+
:type Crop: int
|
|
4423
|
+
:param _Deskew: <p>0表示关闭弯曲矫正<br>1表示开启弯曲矫正,默认为1</p>
|
|
4424
|
+
:type Deskew: int
|
|
4425
|
+
:param _OnlyPosition: <p>0表示返回处理后的图和坐标,默认为0<br>1表示只返回坐标,不返回图片</p>
|
|
4426
|
+
:type OnlyPosition: int
|
|
4427
|
+
:param _EnhanceType: <p>默认-1</p><ul><li>-1 不处理增强</li><li>1 增亮</li><li>2 增强并锐化</li><li>3 黑白</li><li>4 灰度</li><li>5 去阴影增强</li><li>6 点阵图</li></ul>
|
|
4428
|
+
:type EnhanceType: int
|
|
4429
|
+
:param _AdjustOrientation: <p>0表示不矫正图像方向,默认为0 1表示矫正图像方向</p>
|
|
4430
|
+
:type AdjustOrientation: int
|
|
4431
|
+
"""
|
|
4432
|
+
self._ImageBase64 = None
|
|
4433
|
+
self._ImageUrl = None
|
|
4434
|
+
self._PdfPageNumber = None
|
|
4435
|
+
self._Crop = None
|
|
4436
|
+
self._Deskew = None
|
|
4437
|
+
self._OnlyPosition = None
|
|
4438
|
+
self._EnhanceType = None
|
|
4439
|
+
self._AdjustOrientation = None
|
|
4440
|
+
|
|
4441
|
+
@property
|
|
4442
|
+
def ImageBase64(self):
|
|
4443
|
+
r"""<p>图片/PDF的 Base64 值。要求Base64不超过10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。</p>
|
|
4444
|
+
:rtype: str
|
|
4445
|
+
"""
|
|
4446
|
+
return self._ImageBase64
|
|
4447
|
+
|
|
4448
|
+
@ImageBase64.setter
|
|
4449
|
+
def ImageBase64(self, ImageBase64):
|
|
4450
|
+
self._ImageBase64 = ImageBase64
|
|
4451
|
+
|
|
4452
|
+
@property
|
|
4453
|
+
def ImageUrl(self):
|
|
4454
|
+
r"""<p>图片/PDF的 Url 地址。要求图片经Base64编码后不超过10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。图片下载时间不超过 3 秒。图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。</p>
|
|
4455
|
+
:rtype: str
|
|
4456
|
+
"""
|
|
4457
|
+
return self._ImageUrl
|
|
4458
|
+
|
|
4459
|
+
@ImageUrl.setter
|
|
4460
|
+
def ImageUrl(self, ImageUrl):
|
|
4461
|
+
self._ImageUrl = ImageUrl
|
|
4462
|
+
|
|
4463
|
+
@property
|
|
4464
|
+
def PdfPageNumber(self):
|
|
4465
|
+
r"""<p>需要识别的PDF页面的对应页码,仅支持PDF单页识别,默认值为1。</p>
|
|
4466
|
+
:rtype: int
|
|
4467
|
+
"""
|
|
4468
|
+
return self._PdfPageNumber
|
|
4469
|
+
|
|
4470
|
+
@PdfPageNumber.setter
|
|
4471
|
+
def PdfPageNumber(self, PdfPageNumber):
|
|
4472
|
+
self._PdfPageNumber = PdfPageNumber
|
|
4473
|
+
|
|
4474
|
+
@property
|
|
4475
|
+
def Crop(self):
|
|
4476
|
+
r"""<p>0表示关闭切边<br>1表示开启切边,默认为1</p>
|
|
4477
|
+
:rtype: int
|
|
4478
|
+
"""
|
|
4479
|
+
return self._Crop
|
|
4480
|
+
|
|
4481
|
+
@Crop.setter
|
|
4482
|
+
def Crop(self, Crop):
|
|
4483
|
+
self._Crop = Crop
|
|
4484
|
+
|
|
4485
|
+
@property
|
|
4486
|
+
def Deskew(self):
|
|
4487
|
+
r"""<p>0表示关闭弯曲矫正<br>1表示开启弯曲矫正,默认为1</p>
|
|
4488
|
+
:rtype: int
|
|
4489
|
+
"""
|
|
4490
|
+
return self._Deskew
|
|
4491
|
+
|
|
4492
|
+
@Deskew.setter
|
|
4493
|
+
def Deskew(self, Deskew):
|
|
4494
|
+
self._Deskew = Deskew
|
|
4495
|
+
|
|
4496
|
+
@property
|
|
4497
|
+
def OnlyPosition(self):
|
|
4498
|
+
r"""<p>0表示返回处理后的图和坐标,默认为0<br>1表示只返回坐标,不返回图片</p>
|
|
4499
|
+
:rtype: int
|
|
4500
|
+
"""
|
|
4501
|
+
return self._OnlyPosition
|
|
4502
|
+
|
|
4503
|
+
@OnlyPosition.setter
|
|
4504
|
+
def OnlyPosition(self, OnlyPosition):
|
|
4505
|
+
self._OnlyPosition = OnlyPosition
|
|
4506
|
+
|
|
4507
|
+
@property
|
|
4508
|
+
def EnhanceType(self):
|
|
4509
|
+
r"""<p>默认-1</p><ul><li>-1 不处理增强</li><li>1 增亮</li><li>2 增强并锐化</li><li>3 黑白</li><li>4 灰度</li><li>5 去阴影增强</li><li>6 点阵图</li></ul>
|
|
4510
|
+
:rtype: int
|
|
4511
|
+
"""
|
|
4512
|
+
return self._EnhanceType
|
|
4513
|
+
|
|
4514
|
+
@EnhanceType.setter
|
|
4515
|
+
def EnhanceType(self, EnhanceType):
|
|
4516
|
+
self._EnhanceType = EnhanceType
|
|
4517
|
+
|
|
4518
|
+
@property
|
|
4519
|
+
def AdjustOrientation(self):
|
|
4520
|
+
r"""<p>0表示不矫正图像方向,默认为0 1表示矫正图像方向</p>
|
|
4521
|
+
:rtype: int
|
|
4522
|
+
"""
|
|
4523
|
+
return self._AdjustOrientation
|
|
4524
|
+
|
|
4525
|
+
@AdjustOrientation.setter
|
|
4526
|
+
def AdjustOrientation(self, AdjustOrientation):
|
|
4527
|
+
self._AdjustOrientation = AdjustOrientation
|
|
4528
|
+
|
|
4529
|
+
|
|
4530
|
+
def _deserialize(self, params):
|
|
4531
|
+
self._ImageBase64 = params.get("ImageBase64")
|
|
4532
|
+
self._ImageUrl = params.get("ImageUrl")
|
|
4533
|
+
self._PdfPageNumber = params.get("PdfPageNumber")
|
|
4534
|
+
self._Crop = params.get("Crop")
|
|
4535
|
+
self._Deskew = params.get("Deskew")
|
|
4536
|
+
self._OnlyPosition = params.get("OnlyPosition")
|
|
4537
|
+
self._EnhanceType = params.get("EnhanceType")
|
|
4538
|
+
self._AdjustOrientation = params.get("AdjustOrientation")
|
|
4539
|
+
memeber_set = set(params.keys())
|
|
4540
|
+
for name, value in vars(self).items():
|
|
4541
|
+
property_name = name[1:]
|
|
4542
|
+
if property_name in memeber_set:
|
|
4543
|
+
memeber_set.remove(property_name)
|
|
4544
|
+
if len(memeber_set) > 0:
|
|
4545
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
4546
|
+
|
|
4547
|
+
|
|
4548
|
+
|
|
4549
|
+
class CropEnhanceImageOCRResponse(AbstractModel):
|
|
4550
|
+
r"""CropEnhanceImageOCR返回参数结构体
|
|
4551
|
+
|
|
4552
|
+
"""
|
|
4553
|
+
|
|
4554
|
+
def __init__(self):
|
|
4555
|
+
r"""
|
|
4556
|
+
:param _CroppedWidth: <p>处理后图的宽</p>
|
|
4557
|
+
:type CroppedWidth: int
|
|
4558
|
+
:param _CroppedHeight: <p>处理后图的高</p>
|
|
4559
|
+
:type CroppedHeight: int
|
|
4560
|
+
:param _CroppedImage: <p>图像处理后的jpg图片,base64格式</p>
|
|
4561
|
+
:type CroppedImage: str
|
|
4562
|
+
:param _Position: <p>切图区域的4个角点坐标, 是个长度为8的数组<br>[0,1,2,3,4,5,6,7]</p><p>(0,1) 左上角坐标<br>(2,3) 右上角坐标<br>(4,5) 右下角坐标<br>(6,7) 左下角坐标</p>
|
|
4563
|
+
:type Position: list of int
|
|
4564
|
+
:param _Angle: <p>图像角度,AdjustOrientation =1时生效, 返回值如下 -1: 失败 0、90、180、270</p>
|
|
4565
|
+
注意:此字段可能返回 null,表示取不到有效值。
|
|
4566
|
+
:type Angle: int
|
|
4567
|
+
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
|
4568
|
+
:type RequestId: str
|
|
4569
|
+
"""
|
|
4570
|
+
self._CroppedWidth = None
|
|
4571
|
+
self._CroppedHeight = None
|
|
4572
|
+
self._CroppedImage = None
|
|
4573
|
+
self._Position = None
|
|
4574
|
+
self._Angle = None
|
|
4575
|
+
self._RequestId = None
|
|
4576
|
+
|
|
4577
|
+
@property
|
|
4578
|
+
def CroppedWidth(self):
|
|
4579
|
+
r"""<p>处理后图的宽</p>
|
|
4580
|
+
:rtype: int
|
|
4581
|
+
"""
|
|
4582
|
+
return self._CroppedWidth
|
|
4583
|
+
|
|
4584
|
+
@CroppedWidth.setter
|
|
4585
|
+
def CroppedWidth(self, CroppedWidth):
|
|
4586
|
+
self._CroppedWidth = CroppedWidth
|
|
4587
|
+
|
|
4588
|
+
@property
|
|
4589
|
+
def CroppedHeight(self):
|
|
4590
|
+
r"""<p>处理后图的高</p>
|
|
4591
|
+
:rtype: int
|
|
4592
|
+
"""
|
|
4593
|
+
return self._CroppedHeight
|
|
4594
|
+
|
|
4595
|
+
@CroppedHeight.setter
|
|
4596
|
+
def CroppedHeight(self, CroppedHeight):
|
|
4597
|
+
self._CroppedHeight = CroppedHeight
|
|
4598
|
+
|
|
4599
|
+
@property
|
|
4600
|
+
def CroppedImage(self):
|
|
4601
|
+
r"""<p>图像处理后的jpg图片,base64格式</p>
|
|
4602
|
+
:rtype: str
|
|
4603
|
+
"""
|
|
4604
|
+
return self._CroppedImage
|
|
4605
|
+
|
|
4606
|
+
@CroppedImage.setter
|
|
4607
|
+
def CroppedImage(self, CroppedImage):
|
|
4608
|
+
self._CroppedImage = CroppedImage
|
|
4609
|
+
|
|
4610
|
+
@property
|
|
4611
|
+
def Position(self):
|
|
4612
|
+
r"""<p>切图区域的4个角点坐标, 是个长度为8的数组<br>[0,1,2,3,4,5,6,7]</p><p>(0,1) 左上角坐标<br>(2,3) 右上角坐标<br>(4,5) 右下角坐标<br>(6,7) 左下角坐标</p>
|
|
4613
|
+
:rtype: list of int
|
|
4614
|
+
"""
|
|
4615
|
+
return self._Position
|
|
4616
|
+
|
|
4617
|
+
@Position.setter
|
|
4618
|
+
def Position(self, Position):
|
|
4619
|
+
self._Position = Position
|
|
4620
|
+
|
|
4621
|
+
@property
|
|
4622
|
+
def Angle(self):
|
|
4623
|
+
r"""<p>图像角度,AdjustOrientation =1时生效, 返回值如下 -1: 失败 0、90、180、270</p>
|
|
4624
|
+
注意:此字段可能返回 null,表示取不到有效值。
|
|
4625
|
+
:rtype: int
|
|
4626
|
+
"""
|
|
4627
|
+
return self._Angle
|
|
4628
|
+
|
|
4629
|
+
@Angle.setter
|
|
4630
|
+
def Angle(self, Angle):
|
|
4631
|
+
self._Angle = Angle
|
|
4632
|
+
|
|
4633
|
+
@property
|
|
4634
|
+
def RequestId(self):
|
|
4635
|
+
r"""唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
|
4636
|
+
:rtype: str
|
|
4637
|
+
"""
|
|
4638
|
+
return self._RequestId
|
|
4639
|
+
|
|
4640
|
+
@RequestId.setter
|
|
4641
|
+
def RequestId(self, RequestId):
|
|
4642
|
+
self._RequestId = RequestId
|
|
4643
|
+
|
|
4644
|
+
|
|
4645
|
+
def _deserialize(self, params):
|
|
4646
|
+
self._CroppedWidth = params.get("CroppedWidth")
|
|
4647
|
+
self._CroppedHeight = params.get("CroppedHeight")
|
|
4648
|
+
self._CroppedImage = params.get("CroppedImage")
|
|
4649
|
+
self._Position = params.get("Position")
|
|
4650
|
+
self._Angle = params.get("Angle")
|
|
4651
|
+
self._RequestId = params.get("RequestId")
|
|
4652
|
+
|
|
4653
|
+
|
|
4408
4654
|
class CustomsDeclaration(AbstractModel):
|
|
4409
4655
|
r"""海关进/出口货物报关单
|
|
4410
4656
|
|
|
@@ -8383,6 +8629,183 @@ class EnterpriseLicenseOCRResponse(AbstractModel):
|
|
|
8383
8629
|
self._RequestId = params.get("RequestId")
|
|
8384
8630
|
|
|
8385
8631
|
|
|
8632
|
+
class EraseHandwrittenImageOCRRequest(AbstractModel):
|
|
8633
|
+
r"""EraseHandwrittenImageOCR请求参数结构体
|
|
8634
|
+
|
|
8635
|
+
"""
|
|
8636
|
+
|
|
8637
|
+
def __init__(self):
|
|
8638
|
+
r"""
|
|
8639
|
+
:param _ImageBase64: 图片/PDF的 Base64 值。要求Base64不超过10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。
|
|
8640
|
+
:type ImageBase64: str
|
|
8641
|
+
:param _ImageUrl: 图片/PDF的 Url 地址。要求图片经Base64编码后不超过10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。图片下载时间不超过 3 秒。图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。
|
|
8642
|
+
:type ImageUrl: str
|
|
8643
|
+
:param _PdfPageNumber: 需要识别的PDF页面的对应页码,仅支持PDF单页识别,默认值为1。
|
|
8644
|
+
:type PdfPageNumber: int
|
|
8645
|
+
:param _Crop: 0表示关闭切边,默认为0
|
|
8646
|
+
1表示开启切边
|
|
8647
|
+
:type Crop: int
|
|
8648
|
+
:param _Deskew: 0表示关闭弯曲矫正,默认为0
|
|
8649
|
+
1表示开启弯曲矫正
|
|
8650
|
+
:type Deskew: int
|
|
8651
|
+
:param _Sharpen: 0表示关闭增强锐化,默认为0
|
|
8652
|
+
1表示开启增强锐化
|
|
8653
|
+
:type Sharpen: int
|
|
8654
|
+
:param _Grayscale: 0表示返回黑白图像
|
|
8655
|
+
1表示返回彩色图像,默认为1
|
|
8656
|
+
:type Grayscale: int
|
|
8657
|
+
"""
|
|
8658
|
+
self._ImageBase64 = None
|
|
8659
|
+
self._ImageUrl = None
|
|
8660
|
+
self._PdfPageNumber = None
|
|
8661
|
+
self._Crop = None
|
|
8662
|
+
self._Deskew = None
|
|
8663
|
+
self._Sharpen = None
|
|
8664
|
+
self._Grayscale = None
|
|
8665
|
+
|
|
8666
|
+
@property
|
|
8667
|
+
def ImageBase64(self):
|
|
8668
|
+
r"""图片/PDF的 Base64 值。要求Base64不超过10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。
|
|
8669
|
+
:rtype: str
|
|
8670
|
+
"""
|
|
8671
|
+
return self._ImageBase64
|
|
8672
|
+
|
|
8673
|
+
@ImageBase64.setter
|
|
8674
|
+
def ImageBase64(self, ImageBase64):
|
|
8675
|
+
self._ImageBase64 = ImageBase64
|
|
8676
|
+
|
|
8677
|
+
@property
|
|
8678
|
+
def ImageUrl(self):
|
|
8679
|
+
r"""图片/PDF的 Url 地址。要求图片经Base64编码后不超过10M,分辨率建议600*800以上,支持PNG、JPG、JPEG、BMP、PDF格式。图片下载时间不超过 3 秒。图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。
|
|
8680
|
+
:rtype: str
|
|
8681
|
+
"""
|
|
8682
|
+
return self._ImageUrl
|
|
8683
|
+
|
|
8684
|
+
@ImageUrl.setter
|
|
8685
|
+
def ImageUrl(self, ImageUrl):
|
|
8686
|
+
self._ImageUrl = ImageUrl
|
|
8687
|
+
|
|
8688
|
+
@property
|
|
8689
|
+
def PdfPageNumber(self):
|
|
8690
|
+
r"""需要识别的PDF页面的对应页码,仅支持PDF单页识别,默认值为1。
|
|
8691
|
+
:rtype: int
|
|
8692
|
+
"""
|
|
8693
|
+
return self._PdfPageNumber
|
|
8694
|
+
|
|
8695
|
+
@PdfPageNumber.setter
|
|
8696
|
+
def PdfPageNumber(self, PdfPageNumber):
|
|
8697
|
+
self._PdfPageNumber = PdfPageNumber
|
|
8698
|
+
|
|
8699
|
+
@property
|
|
8700
|
+
def Crop(self):
|
|
8701
|
+
r"""0表示关闭切边,默认为0
|
|
8702
|
+
1表示开启切边
|
|
8703
|
+
:rtype: int
|
|
8704
|
+
"""
|
|
8705
|
+
return self._Crop
|
|
8706
|
+
|
|
8707
|
+
@Crop.setter
|
|
8708
|
+
def Crop(self, Crop):
|
|
8709
|
+
self._Crop = Crop
|
|
8710
|
+
|
|
8711
|
+
@property
|
|
8712
|
+
def Deskew(self):
|
|
8713
|
+
r"""0表示关闭弯曲矫正,默认为0
|
|
8714
|
+
1表示开启弯曲矫正
|
|
8715
|
+
:rtype: int
|
|
8716
|
+
"""
|
|
8717
|
+
return self._Deskew
|
|
8718
|
+
|
|
8719
|
+
@Deskew.setter
|
|
8720
|
+
def Deskew(self, Deskew):
|
|
8721
|
+
self._Deskew = Deskew
|
|
8722
|
+
|
|
8723
|
+
@property
|
|
8724
|
+
def Sharpen(self):
|
|
8725
|
+
r"""0表示关闭增强锐化,默认为0
|
|
8726
|
+
1表示开启增强锐化
|
|
8727
|
+
:rtype: int
|
|
8728
|
+
"""
|
|
8729
|
+
return self._Sharpen
|
|
8730
|
+
|
|
8731
|
+
@Sharpen.setter
|
|
8732
|
+
def Sharpen(self, Sharpen):
|
|
8733
|
+
self._Sharpen = Sharpen
|
|
8734
|
+
|
|
8735
|
+
@property
|
|
8736
|
+
def Grayscale(self):
|
|
8737
|
+
r"""0表示返回黑白图像
|
|
8738
|
+
1表示返回彩色图像,默认为1
|
|
8739
|
+
:rtype: int
|
|
8740
|
+
"""
|
|
8741
|
+
return self._Grayscale
|
|
8742
|
+
|
|
8743
|
+
@Grayscale.setter
|
|
8744
|
+
def Grayscale(self, Grayscale):
|
|
8745
|
+
self._Grayscale = Grayscale
|
|
8746
|
+
|
|
8747
|
+
|
|
8748
|
+
def _deserialize(self, params):
|
|
8749
|
+
self._ImageBase64 = params.get("ImageBase64")
|
|
8750
|
+
self._ImageUrl = params.get("ImageUrl")
|
|
8751
|
+
self._PdfPageNumber = params.get("PdfPageNumber")
|
|
8752
|
+
self._Crop = params.get("Crop")
|
|
8753
|
+
self._Deskew = params.get("Deskew")
|
|
8754
|
+
self._Sharpen = params.get("Sharpen")
|
|
8755
|
+
self._Grayscale = params.get("Grayscale")
|
|
8756
|
+
memeber_set = set(params.keys())
|
|
8757
|
+
for name, value in vars(self).items():
|
|
8758
|
+
property_name = name[1:]
|
|
8759
|
+
if property_name in memeber_set:
|
|
8760
|
+
memeber_set.remove(property_name)
|
|
8761
|
+
if len(memeber_set) > 0:
|
|
8762
|
+
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
|
|
8763
|
+
|
|
8764
|
+
|
|
8765
|
+
|
|
8766
|
+
class EraseHandwrittenImageOCRResponse(AbstractModel):
|
|
8767
|
+
r"""EraseHandwrittenImageOCR返回参数结构体
|
|
8768
|
+
|
|
8769
|
+
"""
|
|
8770
|
+
|
|
8771
|
+
def __init__(self):
|
|
8772
|
+
r"""
|
|
8773
|
+
:param _Image: 图像处理后的jpg图片,base64格式
|
|
8774
|
+
:type Image: str
|
|
8775
|
+
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
|
8776
|
+
:type RequestId: str
|
|
8777
|
+
"""
|
|
8778
|
+
self._Image = None
|
|
8779
|
+
self._RequestId = None
|
|
8780
|
+
|
|
8781
|
+
@property
|
|
8782
|
+
def Image(self):
|
|
8783
|
+
r"""图像处理后的jpg图片,base64格式
|
|
8784
|
+
:rtype: str
|
|
8785
|
+
"""
|
|
8786
|
+
return self._Image
|
|
8787
|
+
|
|
8788
|
+
@Image.setter
|
|
8789
|
+
def Image(self, Image):
|
|
8790
|
+
self._Image = Image
|
|
8791
|
+
|
|
8792
|
+
@property
|
|
8793
|
+
def RequestId(self):
|
|
8794
|
+
r"""唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
|
8795
|
+
:rtype: str
|
|
8796
|
+
"""
|
|
8797
|
+
return self._RequestId
|
|
8798
|
+
|
|
8799
|
+
@RequestId.setter
|
|
8800
|
+
def RequestId(self, RequestId):
|
|
8801
|
+
self._RequestId = RequestId
|
|
8802
|
+
|
|
8803
|
+
|
|
8804
|
+
def _deserialize(self, params):
|
|
8805
|
+
self._Image = params.get("Image")
|
|
8806
|
+
self._RequestId = params.get("RequestId")
|
|
8807
|
+
|
|
8808
|
+
|
|
8386
8809
|
class EstateCertOCRRequest(AbstractModel):
|
|
8387
8810
|
r"""EstateCertOCR请求参数结构体
|
|
8388
8811
|
|
|
@@ -13896,7 +14319,7 @@ class IDCardOCRRequest(AbstractModel):
|
|
|
13896
14319
|
:type EnableReflectDetail: bool
|
|
13897
14320
|
:param _EnableDateVerify: <p>用于控制是否开启日期校验,默认值为true,打开会进行日期校验。</p>
|
|
13898
14321
|
:type EnableDateVerify: bool
|
|
13899
|
-
:param _CardWarnType: <p>Basic
|
|
14322
|
+
:param _CardWarnType: <p>告警类型</p><p>枚举值:</p><ul><li>Basic: 使用基础卡证告警能力(含基础PS告警)</li><li>Advanced: 开启进阶PS告警能力,PS告警效果更佳但需要更长耗时</li></ul><p>默认值:Basic</p>
|
|
13900
14323
|
:type CardWarnType: str
|
|
13901
14324
|
"""
|
|
13902
14325
|
self._ImageBase64 = None
|
|
@@ -13991,7 +14414,7 @@ class IDCardOCRRequest(AbstractModel):
|
|
|
13991
14414
|
|
|
13992
14415
|
@property
|
|
13993
14416
|
def CardWarnType(self):
|
|
13994
|
-
r"""<p>Basic
|
|
14417
|
+
r"""<p>告警类型</p><p>枚举值:</p><ul><li>Basic: 使用基础卡证告警能力(含基础PS告警)</li><li>Advanced: 开启进阶PS告警能力,PS告警效果更佳但需要更长耗时</li></ul><p>默认值:Basic</p>
|
|
13995
14418
|
:rtype: str
|
|
13996
14419
|
"""
|
|
13997
14420
|
return self._CardWarnType
|
|
@@ -14043,7 +14466,7 @@ class IDCardOCRResponse(AbstractModel):
|
|
|
14043
14466
|
:type Authority: str
|
|
14044
14467
|
:param _ValidDate: <p>证件有效期(国徽面)</p>
|
|
14045
14468
|
:type ValidDate: str
|
|
14046
|
-
:param _AdvancedInfo: <p>扩展信息,不请求则不返回,具体输入参考示例3和示例4。<br>IdCard,裁剪后身份证照片的base64编码,请求 Config.CropIdCard 时返回;<br>Portrait,身份证头像照片的base64编码,请求 Config.CropPortrait 时返回;<br>Quality,图片质量分数,请求 Config.Quality 时返回(取值范围:0 ~ 100,分数越低越模糊,建议阈值≥50);<br>BorderCodeValue,身份证边框不完整告警阈值分数,请求 Config.BorderCheckWarn时返回(取值范围:0 ~ 100,分数越低边框遮挡可能性越低,建议阈值≤50);<br>WarnInfos,告警信息,Code 告警码列表和释义:<br>-9109 身份证有效日期不合法告警,<br>-9101 身份证边框不完整告警,<br>-9102 身份证复印件告警(黑白及彩色复印件),<br>-9108 身份证复印件告警(仅黑白复印件),<br>-9103 身份证翻拍告警,<br>-9105 身份证框内遮挡告警,<br>-9104 临时身份证告警,<br>-9106 身份证疑似存在PS痕迹告警,<br>-9107 身份证反光告警,<br>-9110
|
|
14469
|
+
:param _AdvancedInfo: <p>扩展信息,不请求则不返回,具体输入参考示例3和示例4。<br>IdCard,裁剪后身份证照片的base64编码,请求 Config.CropIdCard 时返回;<br>Portrait,身份证头像照片的base64编码,请求 Config.CropPortrait 时返回;<br>Quality,图片质量分数,请求 Config.Quality 时返回(取值范围:0 ~ 100,分数越低越模糊,建议阈值≥50);<br>BorderCodeValue,身份证边框不完整告警阈值分数,请求 Config.BorderCheckWarn时返回(取值范围:0 ~ 100,分数越低边框遮挡可能性越低,建议阈值≤50);<br>WarnInfos,告警信息,Code 告警码列表和释义:<br>-9109 身份证有效日期不合法告警,<br>-9101 身份证边框不完整告警,<br>-9102 身份证复印件告警(黑白及彩色复印件),<br>-9108 身份证复印件告警(仅黑白复印件),<br>-9103 身份证翻拍告警,<br>-9105 身份证框内遮挡告警,<br>-9104 临时身份证告警,<br>-9106 身份证疑似存在PS痕迹告警,<br>-9107 身份证反光告警,<br>-9110 电子身份证告警(仅CardWarnType参数为Advanced时),<br>-9111 水印告警</p>
|
|
14047
14470
|
:type AdvancedInfo: str
|
|
14048
14471
|
:param _ReflectDetailInfos: <p>反光点覆盖区域详情结果,具体内容请点击左侧链接</p>
|
|
14049
14472
|
:type ReflectDetailInfos: list of ReflectDetailInfo
|
|
@@ -14152,7 +14575,7 @@ class IDCardOCRResponse(AbstractModel):
|
|
|
14152
14575
|
|
|
14153
14576
|
@property
|
|
14154
14577
|
def AdvancedInfo(self):
|
|
14155
|
-
r"""<p>扩展信息,不请求则不返回,具体输入参考示例3和示例4。<br>IdCard,裁剪后身份证照片的base64编码,请求 Config.CropIdCard 时返回;<br>Portrait,身份证头像照片的base64编码,请求 Config.CropPortrait 时返回;<br>Quality,图片质量分数,请求 Config.Quality 时返回(取值范围:0 ~ 100,分数越低越模糊,建议阈值≥50);<br>BorderCodeValue,身份证边框不完整告警阈值分数,请求 Config.BorderCheckWarn时返回(取值范围:0 ~ 100,分数越低边框遮挡可能性越低,建议阈值≤50);<br>WarnInfos,告警信息,Code 告警码列表和释义:<br>-9109 身份证有效日期不合法告警,<br>-9101 身份证边框不完整告警,<br>-9102 身份证复印件告警(黑白及彩色复印件),<br>-9108 身份证复印件告警(仅黑白复印件),<br>-9103 身份证翻拍告警,<br>-9105 身份证框内遮挡告警,<br>-9104 临时身份证告警,<br>-9106 身份证疑似存在PS痕迹告警,<br>-9107 身份证反光告警,<br>-9110
|
|
14578
|
+
r"""<p>扩展信息,不请求则不返回,具体输入参考示例3和示例4。<br>IdCard,裁剪后身份证照片的base64编码,请求 Config.CropIdCard 时返回;<br>Portrait,身份证头像照片的base64编码,请求 Config.CropPortrait 时返回;<br>Quality,图片质量分数,请求 Config.Quality 时返回(取值范围:0 ~ 100,分数越低越模糊,建议阈值≥50);<br>BorderCodeValue,身份证边框不完整告警阈值分数,请求 Config.BorderCheckWarn时返回(取值范围:0 ~ 100,分数越低边框遮挡可能性越低,建议阈值≤50);<br>WarnInfos,告警信息,Code 告警码列表和释义:<br>-9109 身份证有效日期不合法告警,<br>-9101 身份证边框不完整告警,<br>-9102 身份证复印件告警(黑白及彩色复印件),<br>-9108 身份证复印件告警(仅黑白复印件),<br>-9103 身份证翻拍告警,<br>-9105 身份证框内遮挡告警,<br>-9104 临时身份证告警,<br>-9106 身份证疑似存在PS痕迹告警,<br>-9107 身份证反光告警,<br>-9110 电子身份证告警(仅CardWarnType参数为Advanced时),<br>-9111 水印告警</p>
|
|
14156
14579
|
:rtype: str
|
|
14157
14580
|
"""
|
|
14158
14581
|
return self._AdvancedInfo
|
|
@@ -250,6 +250,31 @@ class OcrClient(AbstractClient):
|
|
|
250
250
|
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
251
251
|
|
|
252
252
|
|
|
253
|
+
def CropEnhanceImageOCR(self, request):
|
|
254
|
+
r"""图像切边矫正增强是面向文档类图片提供的图像增强处理能力,包括切边增强、图像矫正、阴影去除、摩尔纹去除等;可以有效优化文档类的图片质量,提升文字的清晰度,可以作为所有识别场景的图像预处理原子能力,从而提升识别效果。
|
|
255
|
+
|
|
256
|
+
默认接口请求频率限制:5次/秒。
|
|
257
|
+
|
|
258
|
+
:param request: Request instance for CropEnhanceImageOCR.
|
|
259
|
+
:type request: :class:`tencentcloud.ocr.v20181119.models.CropEnhanceImageOCRRequest`
|
|
260
|
+
:rtype: :class:`tencentcloud.ocr.v20181119.models.CropEnhanceImageOCRResponse`
|
|
261
|
+
|
|
262
|
+
"""
|
|
263
|
+
try:
|
|
264
|
+
params = request._serialize()
|
|
265
|
+
headers = request.headers
|
|
266
|
+
body = self.call("CropEnhanceImageOCR", params, headers=headers)
|
|
267
|
+
response = json.loads(body)
|
|
268
|
+
model = models.CropEnhanceImageOCRResponse()
|
|
269
|
+
model._deserialize(response["Response"])
|
|
270
|
+
return model
|
|
271
|
+
except Exception as e:
|
|
272
|
+
if isinstance(e, TencentCloudSDKException):
|
|
273
|
+
raise
|
|
274
|
+
else:
|
|
275
|
+
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
276
|
+
|
|
277
|
+
|
|
253
278
|
def DescribeExtractDocAgentJob(self, request):
|
|
254
279
|
r"""模型参数更大,速度更慢。推荐场景:可以接受异步(超过30s返回),样本输入输出token大于2000,长文本类文档建议用异步模型。需要 SubmitExtractDocAgentJob(提交任务)、DescribeExtractDocAgentJob(查询任务)两个接口配套使用,计费发生在提交任务后。【备注:1.固定价格不限抽取字段数,2.自适应价格抽取字段大于10记两次费用,小于等于10记一次费用】
|
|
255
280
|
|
|
@@ -431,6 +456,31 @@ class OcrClient(AbstractClient):
|
|
|
431
456
|
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
432
457
|
|
|
433
458
|
|
|
459
|
+
def EraseHandwrittenImageOCR(self, request):
|
|
460
|
+
r"""本功能可自动清除试卷图片中的手写与批改痕迹,并输出洁净的空白试卷。也可以配合集成图像切边矫正技术,能自动定位、拉平试卷区域,从而在最优预处理基础上实现更佳的擦除效果。
|
|
461
|
+
|
|
462
|
+
默认接口请求频率限制:5次/秒。
|
|
463
|
+
|
|
464
|
+
:param request: Request instance for EraseHandwrittenImageOCR.
|
|
465
|
+
:type request: :class:`tencentcloud.ocr.v20181119.models.EraseHandwrittenImageOCRRequest`
|
|
466
|
+
:rtype: :class:`tencentcloud.ocr.v20181119.models.EraseHandwrittenImageOCRResponse`
|
|
467
|
+
|
|
468
|
+
"""
|
|
469
|
+
try:
|
|
470
|
+
params = request._serialize()
|
|
471
|
+
headers = request.headers
|
|
472
|
+
body = self.call("EraseHandwrittenImageOCR", params, headers=headers)
|
|
473
|
+
response = json.loads(body)
|
|
474
|
+
model = models.EraseHandwrittenImageOCRResponse()
|
|
475
|
+
model._deserialize(response["Response"])
|
|
476
|
+
return model
|
|
477
|
+
except Exception as e:
|
|
478
|
+
if isinstance(e, TencentCloudSDKException):
|
|
479
|
+
raise
|
|
480
|
+
else:
|
|
481
|
+
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
482
|
+
|
|
483
|
+
|
|
434
484
|
def EstateCertOCR(self, request):
|
|
435
485
|
r"""本接口支持不动产权证关键字段的识别,包括使用期限、面积、用途、权利性质、权利类型、坐落、共有情况、权利人、权利其他状况等。
|
|
436
486
|
|
|
@@ -204,6 +204,26 @@ class OcrClient(AbstractClient):
|
|
|
204
204
|
|
|
205
205
|
return await self.call_and_deserialize(**kwargs)
|
|
206
206
|
|
|
207
|
+
async def CropEnhanceImageOCR(
|
|
208
|
+
self,
|
|
209
|
+
request: models.CropEnhanceImageOCRRequest,
|
|
210
|
+
opts: Dict = None,
|
|
211
|
+
) -> models.CropEnhanceImageOCRResponse:
|
|
212
|
+
"""
|
|
213
|
+
图像切边矫正增强是面向文档类图片提供的图像增强处理能力,包括切边增强、图像矫正、阴影去除、摩尔纹去除等;可以有效优化文档类的图片质量,提升文字的清晰度,可以作为所有识别场景的图像预处理原子能力,从而提升识别效果。
|
|
214
|
+
|
|
215
|
+
默认接口请求频率限制:5次/秒。
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
kwargs = {}
|
|
219
|
+
kwargs["action"] = "CropEnhanceImageOCR"
|
|
220
|
+
kwargs["params"] = request._serialize()
|
|
221
|
+
kwargs["resp_cls"] = models.CropEnhanceImageOCRResponse
|
|
222
|
+
kwargs["headers"] = request.headers
|
|
223
|
+
kwargs["opts"] = opts or {}
|
|
224
|
+
|
|
225
|
+
return await self.call_and_deserialize(**kwargs)
|
|
226
|
+
|
|
207
227
|
async def DescribeExtractDocAgentJob(
|
|
208
228
|
self,
|
|
209
229
|
request: models.DescribeExtractDocAgentJobRequest,
|
|
@@ -350,6 +370,26 @@ class OcrClient(AbstractClient):
|
|
|
350
370
|
|
|
351
371
|
return await self.call_and_deserialize(**kwargs)
|
|
352
372
|
|
|
373
|
+
async def EraseHandwrittenImageOCR(
|
|
374
|
+
self,
|
|
375
|
+
request: models.EraseHandwrittenImageOCRRequest,
|
|
376
|
+
opts: Dict = None,
|
|
377
|
+
) -> models.EraseHandwrittenImageOCRResponse:
|
|
378
|
+
"""
|
|
379
|
+
本功能可自动清除试卷图片中的手写与批改痕迹,并输出洁净的空白试卷。也可以配合集成图像切边矫正技术,能自动定位、拉平试卷区域,从而在最优预处理基础上实现更佳的擦除效果。
|
|
380
|
+
|
|
381
|
+
默认接口请求频率限制:5次/秒。
|
|
382
|
+
"""
|
|
383
|
+
|
|
384
|
+
kwargs = {}
|
|
385
|
+
kwargs["action"] = "EraseHandwrittenImageOCR"
|
|
386
|
+
kwargs["params"] = request._serialize()
|
|
387
|
+
kwargs["resp_cls"] = models.EraseHandwrittenImageOCRResponse
|
|
388
|
+
kwargs["headers"] = request.headers
|
|
389
|
+
kwargs["opts"] = opts or {}
|
|
390
|
+
|
|
391
|
+
return await self.call_and_deserialize(**kwargs)
|
|
392
|
+
|
|
353
393
|
async def EstateCertOCR(
|
|
354
394
|
self,
|
|
355
395
|
request: models.EstateCertOCRRequest,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tencentcloud-sdk-python-ocr
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.130
|
|
4
4
|
Summary: Tencent Cloud Ocr SDK for Python
|
|
5
5
|
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
6
|
Author: Tencent Cloud
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 2.7
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.6
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
-
Requires-Dist: tencentcloud-sdk-python-common <4.0.0,>=3.1.
|
|
18
|
+
Requires-Dist: tencentcloud-sdk-python-common <4.0.0,>=3.1.130
|
|
19
19
|
|
|
20
20
|
============================
|
|
21
21
|
Tencent Cloud SDK for Python
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
tencentcloud/__init__.py,sha256=OqHtlRcyw1JSGHtl8DkicKrWgl2KrUlgsAKTW9AZpWU,630
|
|
2
|
+
tencentcloud/ocr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
tencentcloud/ocr/v20181119/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
tencentcloud/ocr/v20181119/errorcodes.py,sha256=JIZv0T7mSsIMfQKdQjHDSsF8oW-b9rJTZovBM5qM9xU,7187
|
|
5
|
+
tencentcloud/ocr/v20181119/models.py,sha256=-NWg9XKaxaBcpydhQhphtB0LjfsMDA7Z6RbMuLpc4vY,1392098
|
|
6
|
+
tencentcloud/ocr/v20181119/ocr_client.py,sha256=_Hz1huJg0qwPoW-QjKY63XkUYxst6BgEFM9pghKTQAw,120211
|
|
7
|
+
tencentcloud/ocr/v20181119/ocr_client_async.py,sha256=Zfso_mRk-TNaBxW8fi26BcZqIl_DFzRoOzmRBtPGqfI,95614
|
|
8
|
+
tencentcloud_sdk_python_ocr-3.1.130.dist-info/METADATA,sha256=dStuJnGuNsfO7gVrL0QWcwHUXnjMEwA7W7u2aygW1EY,1497
|
|
9
|
+
tencentcloud_sdk_python_ocr-3.1.130.dist-info/WHEEL,sha256=a5ogxI61vGGBHYbAAwISCXsfU7mxKr76gTpCEmSNOI8,109
|
|
10
|
+
tencentcloud_sdk_python_ocr-3.1.130.dist-info/top_level.txt,sha256=g-8OyzoqI6O6LiS85zkeNzhB-osEnRIPZMdyRd_0eL0,13
|
|
11
|
+
tencentcloud_sdk_python_ocr-3.1.130.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
tencentcloud/__init__.py,sha256=vZZAZ-rWq3WOdn_a3Mhcl_RuBIJLLYDedHQ-p0QzJFw,630
|
|
2
|
-
tencentcloud/ocr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
tencentcloud/ocr/v20181119/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
tencentcloud/ocr/v20181119/errorcodes.py,sha256=JIZv0T7mSsIMfQKdQjHDSsF8oW-b9rJTZovBM5qM9xU,7187
|
|
5
|
-
tencentcloud/ocr/v20181119/models.py,sha256=QsDeCcc91mYUsxUcHx_L-CEvSEPNpcQnlB0uA7CN9QQ,1376433
|
|
6
|
-
tencentcloud/ocr/v20181119/ocr_client.py,sha256=JUk2MqfHJz37EHko0zy74dggRwBSuscG4wzQQPGoqOM,117778
|
|
7
|
-
tencentcloud/ocr/v20181119/ocr_client_async.py,sha256=eSMaNonnD21074RdTmD7nMcjWqqae8tVrnHGZ5esroA,93788
|
|
8
|
-
tencentcloud_sdk_python_ocr-3.1.127.dist-info/METADATA,sha256=St2iwW_0xJ3mu7LplRkPNVWGtPA1IIMQOmpQ6a7NyHU,1497
|
|
9
|
-
tencentcloud_sdk_python_ocr-3.1.127.dist-info/WHEEL,sha256=a5ogxI61vGGBHYbAAwISCXsfU7mxKr76gTpCEmSNOI8,109
|
|
10
|
-
tencentcloud_sdk_python_ocr-3.1.127.dist-info/top_level.txt,sha256=g-8OyzoqI6O6LiS85zkeNzhB-osEnRIPZMdyRd_0eL0,13
|
|
11
|
-
tencentcloud_sdk_python_ocr-3.1.127.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|