mirror of
https://github.com/allenai/olmocr.git
synced 2025-10-14 01:32:31 +00:00
Move open cv2 import only into experimental data loader class
This commit is contained in:
parent
93411a80a0
commit
11302feb8c
@ -21,7 +21,6 @@ from typing import (
|
||||
get_origin,
|
||||
)
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
import yaml
|
||||
from PIL import Image
|
||||
@ -533,6 +532,9 @@ class AugraphyBasicAugmentations(PipelineStep):
|
||||
if "image" not in sample:
|
||||
return sample
|
||||
|
||||
# Import opencv only here
|
||||
import cv2
|
||||
|
||||
image = sample["image"]
|
||||
|
||||
# Skip all augmentations based on overall probability
|
||||
|
Loading…
x
Reference in New Issue
Block a user