Upload model
Browse files- configuration_rf_detr.py +1 -1
- 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",
|
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)
|