Thastp commited on
Commit
47dc41d
·
verified ·
1 Parent(s): 1ccdd79

Upload model

Browse files
Files changed (2) hide show
  1. configuration_rf_detr.py +1 -1
  2. modeling_rf_detr.py +1 -1
configuration_rf_detr.py CHANGED
@@ -72,7 +72,7 @@ class RFDetrOnnxConfig(ViTOnnxConfig):
72
  return OrderedDict(
73
  {
74
  "pixel_values": {0: "batch_size", 1: "num_channels", 2: "height", 3: "width"},
75
- "pixel_mask": {0: "batch_size", 2: "height", 3: "width"},
76
  }
77
  )
78
 
 
72
  return OrderedDict(
73
  {
74
  "pixel_values": {0: "batch_size", 1: "num_channels", 2: "height", 3: "width"},
75
+ "pixel_mask": {0: "batch_size", 1: "height", 2: "width"},
76
  }
77
  )
78
 
modeling_rf_detr.py CHANGED
@@ -118,7 +118,7 @@ class RFDetrModelForObjectDetection(PreTrainedModel):
118
  label["labels"] = label["labels"].to(self.config.device)
119
 
120
  def forward(self, pixel_values: torch.Tensor, pixel_mask: torch.Tensor, labels=None, **kwargs) -> ModelOutput:
121
- resize = Resize((self.config.resolution, self.config.resolution))
122
 
123
  if labels is not None:
124
  self.validate_labels(labels)
 
118
  label["labels"] = label["labels"].to(self.config.device)
119
 
120
  def forward(self, pixel_values: torch.Tensor, pixel_mask: torch.Tensor, labels=None, **kwargs) -> ModelOutput:
121
+ resize = Resize((self.config.resolution, self.config.resolution), antialias=False) # antialias set to False for onnx export
122
 
123
  if labels is not None:
124
  self.validate_labels(labels)