Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to load a 3D point cloud from a file.
Computer Vision
import open3d as o3d point_cloud = o3d.io.read_point_cloud([1]) print(point_cloud)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a number instead of a string path.
Forgetting to put quotes around the file path.
✗ Incorrect
The read_point_cloud function requires a string path to the point cloud file.
2fill in blank
mediumComplete the code to create a 3D bounding box from a point cloud.
Computer Vision
bbox = point_cloud.get_axis_aligned_bounding_box() print(bbox.[1]())
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using area() which is for 2D shapes.
Using center() which returns a point, not a size.
✗ Incorrect
The volume() method returns the volume of the bounding box.
3fill in blank
hardFix the error in the code to visualize the point cloud with bounding box.
Computer Vision
import open3d as o3d vis = o3d.visualization.Visualizer() vis.create_window() vis.add_geometry(point_cloud) vis.add_geometry([1]) vis.run() vis.destroy_window()
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding the point cloud twice instead of the bounding box.
Adding None or creating a new empty geometry.
✗ Incorrect
The bounding box object 'bbox' must be added to the visualizer to show it.
4fill in blank
hardFill both blanks to filter points inside the bounding box.
Computer Vision
points = np.asarray(point_cloud.points) mask = (points[:, [1]] >= bbox.min_bound[[2]]) & (points[:, [1]] <= bbox.max_bound[[2]]) filtered_points = points[mask]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different indices for points and bounding box bounds.
Using an invalid axis index like 3.
✗ Incorrect
To filter along the x-axis, use index 0 for both point coordinates and bounding box bounds.
5fill in blank
hardFill all three blanks to train a simple 3D object detection model using PyTorch.
Computer Vision
import torch import torch.nn as nn class Simple3DDetector(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear([1], 64) self.relu = nn.ReLU() self.fc2 = nn.Linear(64, [2]) def forward(self, x): x = self.relu(self.fc1(x)) x = self.fc2(x) return x model = Simple3DDetector() input_tensor = torch.randn(10, [3]) output = model(input_tensor) print(output.shape)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatching input tensor size with model input layer.
Wrong output size for classification.
✗ Incorrect
Input features are 3 (x,y,z), output classes 2 (object or no object), input tensor batch size 10 with 3 features.