Skip to content

Segformer Semantic Segmentation #286

Segformer Semantic Segmentation

Segformer Semantic Segmentation #286

GitHub Actions / Autopep8 failed Jun 14, 2024 in 0s

5 errors

Autopep8 found 5 errors

Annotations

Check failure on line 23 in src/perception/semantic_segmentation/launch/semantic_segmentation.launch.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/semantic_segmentation/launch/semantic_segmentation.launch.py#L16-L23

         executable='semantic_segmentation_node',
         name='semantic_segmentation_node',
         parameters=[config]
-        )
+    )
 
     # finalize
     ld.add_action(semantic_segmentation_node)

Check failure on line 32 in src/perception/semantic_segmentation/semantic_segmentation/segmentation_node.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/semantic_segmentation/semantic_segmentation/segmentation_node.py#L24-L32

 package_name = 'semantic_segmentation'
 package_share_directory = get_package_share_directory(package_name)
 CONFIG = os.path.join(package_share_directory, 'resource', 'model',
-                       'segformer_mit-b2_8xb1-160k_cityscapes-1024x1024.py')
-CHECKPOINT = os.path.join(package_share_directory, 'resource', 'model', 
+                      'segformer_mit-b2_8xb1-160k_cityscapes-1024x1024.py')
+CHECKPOINT = os.path.join(package_share_directory, 'resource', 'model',
                           'segformer_mit-b2_8x1_1024x1024_160k_cityscapes_20211207_134205-6096669a.pth')
 
 IMAGE_H = 900

Check failure on line 76 in src/perception/semantic_segmentation/semantic_segmentation/segmentation_node.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/semantic_segmentation/semantic_segmentation/segmentation_node.py#L69-L76

         self.declare_parameter('config', "model/segformer_mit-b2_8xb1-160k_cityscapes-1024x1024.py")
         self.declare_parameter(
             'checkpoint', "model/segformer_mit-b2_8x1_1024x1024_160k_cityscapes_20211207_134205-6096669a.pth")
-        
+
         self.compressed = self.get_parameter('compressed').value
         self.image_subscription = self.create_subscription(
             Image if not self.compressed else CompressedImage,

Check failure on line 116 in src/perception/semantic_segmentation/semantic_segmentation/segmentation_node.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/semantic_segmentation/semantic_segmentation/segmentation_node.py#L106-L116

                 except CvBridgeError as e:
                     self.get_logger().error(str(e))
                     return
-        
+
         with torch.no_grad():
             out_img = self.model(image, show=False, )['predictions']
-    
+
         # logits = torch.tensor(out_img, dtype=torch.float32).unsqueeze(0).unsqueeze(0)  # Add batch and channel dimensions
         # upsampled_logits = torch.nn.functional.interpolate(logits,
         #                                                    size=(IMAGE_H, IMAGE_W),  # (height, width)

Check failure on line 135 in src/perception/semantic_segmentation/semantic_segmentation/segmentation_node.py

See this annotation in the file changed.

@github-actions github-actions / Autopep8

src/perception/semantic_segmentation/semantic_segmentation/segmentation_node.py#L128-L135

         self.image_publisher.publish(mask_output)
 
 
-
 def main(args=None):
 
     rclpy.init(args=args)