File tree Expand file tree Collapse file tree 1 file changed +6
-26
lines changed Expand file tree Collapse file tree 1 file changed +6
-26
lines changed Original file line number Diff line number Diff line change 20
20
from absl import logging
21
21
import tensorflow as tf
22
22
23
- from official .core import config_definitions as cfg
24
23
from official .vision import configs
25
24
from official .vision .modeling import factory
26
25
from official .vision .ops import anchor
32
31
class DetectionModule (export_base .ExportModule ):
33
32
"""Detection Module."""
34
33
35
- def __init__ (
36
- self ,
37
- params : cfg .ExperimentConfig ,
38
- * ,
39
- input_image_size : list [int ],
40
- ** kwargs ,
41
- ):
42
- """Initializes a detection module for export.
43
-
44
- Args:
45
- params: Experiment params.
46
- input_image_size: List or Tuple of size of the input image. For 2D image,
47
- it is [height, width].
48
- **kwargs: All other kwargs are passed to `export_base.ExportModule`; see
49
- the documentation on `export_base.ExportModule` for valid arguments.
50
- """
51
- if params .task .train_data .parser .pad :
52
- self ._padded_size = preprocess_ops .compute_padded_size (
53
- input_image_size , 2 ** params .task .model .max_level
34
+ @property
35
+ def _padded_size (self ):
36
+ if self .params .task .train_data .parser .pad :
37
+ return preprocess_ops .compute_padded_size (
38
+ self ._input_image_size , 2 ** self .params .task .model .max_level
54
39
)
55
40
else :
56
- self ._padded_size = input_image_size
57
- super ().__init__ (
58
- params = params ,
59
- input_image_size = input_image_size ,
60
- ** kwargs ,
61
- )
41
+ return self ._input_image_size
62
42
63
43
def _build_model (self ):
64
44
You can’t perform that action at this time.
0 commit comments