Skip to content

Commit

Permalink
Fix undesired behavior of transform.PreprocessCfg
Browse files Browse the repository at this point in the history
  • Loading branch information
bryant1410 authored and rwightman committed Oct 23, 2023
1 parent 7b8dd2c commit dc463ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/open_clip/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class PreprocessCfg:
fill_color: int = 0

def __post_init__(self):
assert self.mode in ('RGB')
assert self.mode in ('RGB',)

@property
def num_channels(self):
return 3

@property
def input_size(self):
return (self.num_channels(),) + to_2tuple(self.size)
return (self.num_channels,) + to_2tuple(self.size)

_PREPROCESS_KEYS = set(asdict(PreprocessCfg()).keys())

Expand Down Expand Up @@ -403,4 +403,4 @@ def image_transform_v2(
interpolation=cfg.interpolation,
resize_mode=cfg.resize_mode,
fill_color=cfg.fill_color,
)
)

0 comments on commit dc463ae

Please sign in to comment.