class_docstr: A `RegionDetector` that returns two proposals per image, for testing purposes.  The features for
  the proposal are a random 10-dimensional vector, and the coordinates are the size of the image.
class_docstr_tok: ["A","`","RegionDetector","`","that","returns","two","proposals","per","image",",","for","testing","purposes",".","The","features","for","the","proposal","are","a","random","10-dimensional","vector",",","and","the","coordinates","are","the","size","of","the","image","."]
code: def forward(
      self,
      images: FloatTensor,
      sizes: IntTensor,
      image_features: "OrderedDict[str, FloatTensor]",
  ) -> RegionDetectorOutput:
      batch_size, num_features, height, width = images.size()
      features = [
          self._seeded_random_tensor(2, 10, device=images.device)
          for _ in range(batch_size)
      ]
      boxes = [
          torch.zeros(2, 4, dtype=torch.float32, device=images.device)
          for _ in range(batch_size)
      ]
      for image_num in range(batch_size):
          boxes[image_num][0, 2] = sizes[image_num, 0]
          boxes[image_num][0, 3] = sizes[image_num, 1]
          boxes[image_num][1, 2] = sizes[image_num, 0]
          boxes[image_num][1, 3] = sizes[image_num, 1]
      return RegionDetectorOutput(features, boxes)
  
imports: import itertools
  import random
  from collections import OrderedDict
  from typing import NamedTuple, Optional, List, Tuple
  import torch
  from torch import nn, FloatTensor, IntTensor, Tensor
  import torch.nn.functional
  import torchvision
  import torchvision.ops.boxes
  from allennlp.common import Registrable
label_desc: Use image node_id 3 for calling the RandomRegionDetector obj's underlying member method code with example usage: obj.forward(images, sizes, image_features) and returns: RegionDetectorOutput