Skip to content

Commit

Permalink
default to cubic
Browse files Browse the repository at this point in the history
  • Loading branch information
AshishKumar4 committed Aug 13, 2024
1 parent 565475c commit 24f7702
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flaxdiff/data/online_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def fetch_single_image(image_url, timeout=None, retries=0):
return image


def default_image_processor(image, image_shape, interpolation=cv2.INTER_LANCZOS4):
def default_image_processor(image, image_shape, interpolation=cv2.INTER_CUBIC):
image = A.longest_max_size(image, max(
image_shape), interpolation=interpolation)
image = A.pad(
Expand All @@ -62,7 +62,7 @@ def map_sample(
image_shape=(256, 256),
timeout=15,
retries=3,
upscale_interpolation=cv2.INTER_LANCZOS4,
upscale_interpolation=cv2.INTER_CUBIC,
downscale_interpolation=cv2.INTER_AREA,
image_processor=default_image_processor,
):
Expand Down Expand Up @@ -108,7 +108,7 @@ def map_sample(
def map_batch(
batch, num_threads=256, image_shape=(256, 256),
timeout=15, retries=3, image_processor=default_image_processor,
upscale_interpolation=cv2.INTER_LANCZOS4,
upscale_interpolation=cv2.INTER_CUBIC,
downscale_interpolation=cv2.INTER_AREA,
):
try:
Expand All @@ -128,7 +128,7 @@ def map_batch(
def parallel_image_loader(
dataset: Dataset, num_workers: int = 8, image_shape=(256, 256),
num_threads=256, timeout=15, retries=3, image_processor=default_image_processor,
upscale_interpolation=cv2.INTER_LANCZOS4,
upscale_interpolation=cv2.INTER_CUBIC,
downscale_interpolation=cv2.INTER_AREA,
):
map_batch_fn = partial(map_batch, num_threads=num_threads, image_shape=image_shape,
Expand Down Expand Up @@ -158,7 +158,7 @@ def __init__(
self, dataset: Dataset, batch_size: int = 64, image_shape=(256, 256),
num_workers: int = 8, num_threads=256, timeout=15, retries=3,
image_processor=default_image_processor,
upscale_interpolation=cv2.INTER_LANCZOS4,
upscale_interpolation=cv2.INTER_CUBIC,
downscale_interpolation=cv2.INTER_AREA,
):
self.dataset = dataset
Expand Down Expand Up @@ -230,7 +230,7 @@ def __init__(
timeout=15,
retries=3,
image_processor=default_image_processor,
upscale_interpolation=cv2.INTER_LANCZOS4,
upscale_interpolation=cv2.INTER_CUBIC,
downscale_interpolation=cv2.INTER_AREA,
):
if isinstance(dataset, str):
Expand Down

0 comments on commit 24f7702

Please sign in to comment.