Пример #1
0
    def __init__(self,
                 source_map_size, world_size_px,
                 world_size, img_w, img_h,
                 embed_size, map_channels, gnd_channels, res_channels=32,
                 lang_filter=False, img_dbg=False):
        super(FPVToEgoMap, self).__init__(source_map_size, world_size_px)

        self.image_debug = img_dbg
        self.use_lang_filter = lang_filter

        # Process images using a resnet to get a feature map
        if self.image_debug:
            self.img_to_features = nn.MaxPool2d(8)
        else:
            # Provide enough padding so that the map is scaled down by powers of 2.
            self.img_to_features = ImgToFeatures(res_channels, map_channels)

        if self.use_lang_filter:
            self.lang_filter = MapLangSemanticFilter(embed_size, map_channels, gnd_channels)

        # Project feature maps to the global frame
        self.map_projection = PinholeCameraProjectionModule(
            source_map_size, world_size_px, world_size, source_map_size / 2, img_w, img_h)

        self.grid_sampler = GridSampler()

        self.prof = SimpleProfiler(torch_sync=PROFILE, print=PROFILE)

        self.actual_images = None
Пример #2
0
    def __init__(self,
                 img_w,
                 img_h,
                 res_channels,
                 map_channels,
                 img_dbg=False):
        super(FPVToFPVMap, self).__init__()

        self.image_debug = img_dbg

        # Provide enough padding so that the map is scaled down by powers of 2.
        self.img_to_features = ImgToFeatures(res_channels, map_channels, img_w,
                                             img_h)
        self.prof = SimpleProfiler(torch_sync=PROFILE, print=PROFILE)
        self.actual_images = None
Пример #3
0
    def __init__(self,
                 source_map_size,
                 world_size_px,
                 world_size_m,
                 img_w,
                 img_h,
                 res_channels,
                 map_channels,
                 cam_h_fov,
                 domain,
                 img_dbg=False):

        super(FPVToGlobalMap, self).__init__(source_map_size, world_size_px,
                                             world_size_m)

        self.image_debug = img_dbg

        self.use_lang_filter = False

        # Process images using a resnet to get a feature map
        if self.image_debug:
            self.img_to_features = nn.MaxPool2d(8)
        else:
            # Provide enough padding so that the map is scaled down by powers of 2.
            self.img_to_features = ImgToFeatures(res_channels, map_channels,
                                                 img_w, img_h)

        # Project feature maps to the global frame
        self.map_projection = PinholeCameraProjectionModuleGlobal(
            source_map_size, world_size_px, world_size_m, img_w, img_h,
            cam_h_fov, domain)

        self.grid_sampler = GridSampler()

        self.prof = SimpleProfiler(torch_sync=PROFILE, print=PROFILE)

        self.actual_images = None