mirror of
https://github.com/allenai/olmocr.git
synced 2025-10-14 09:42:47 +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,
|
get_origin,
|
||||||
)
|
)
|
||||||
|
|
||||||
import cv2
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import yaml
|
import yaml
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
@ -533,6 +532,9 @@ class AugraphyBasicAugmentations(PipelineStep):
|
|||||||
if "image" not in sample:
|
if "image" not in sample:
|
||||||
return sample
|
return sample
|
||||||
|
|
||||||
|
# Import opencv only here
|
||||||
|
import cv2
|
||||||
|
|
||||||
image = sample["image"]
|
image = sample["image"]
|
||||||
|
|
||||||
# Skip all augmentations based on overall probability
|
# Skip all augmentations based on overall probability
|
||||||
|
Loading…
x
Reference in New Issue
Block a user