googleapis / googleapis/google-cloud-python

Apply Transforms Field to Bounding Boxes

Đang mở
#15,824 1 bình luận 0 reaction 1 người được giao Được @nayaknishant nhận Xem trên GitHub
Ngôn ngữ chính
Python
Star
5.4k
Fork
1.8k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
122

Mô tả

I understand that Document AI performs preprocessing to correct for issues like skew in documents sent to the API, and that any transformations applied are provided in the response under the transforms field. It would be massively helpful to have a function I can call on the Document object to the undo the preprocessing so that the bounding boxes are relative to the submitted document, not the preprocessed document.

I've spent a few weeks trying to implement this myself (and have a support request that's been in limbo for about a month and a half), and unfortunately haven't been able to make any progress. Admittedly, I have pretty limited experience with OpenCV, so I may be missing something.

Attached are images of a document I uploaded to GCP, the corresponding preprocessed image that GCP returns in the images field, and the output of the bounding boxes when I attempt to apply the transforms. If you look closely at the text layer, it doesn't match up with the original image.

![original](https://github.com/googleapis/google-cloud-python/assets/129619515/473dd272-edb4-4b26-84c9-ca8f496d0b74)
![gcp_preprocessed_image](https://github.com/googleapis/google-cloud-python/assets/129619515/8922a248-0bce-4296-8b0c-e61348affac8)
![output_text_layer](https://github.com/googleapis/google-cloud-python/assets/129619515/ab88e6d4-89ff-4d65-adf8-7184db3ee856)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.