Skip to content

Commit

Permalink
Merge pull request #524 from lilianmallardeau/master
Browse files Browse the repository at this point in the history
Fix indentation inconsistency in python scripts + typos in readme
  • Loading branch information
P-yver authored Jan 3, 2023
2 parents def6ae1 + 88428aa commit 0873d62
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 31 deletions.
2 changes: 1 addition & 1 deletion object detection/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZED SDK - Object Detection

- **Birds eye viewer**: Deteted objects are displayed in a **3D** view with the current point cloud.
- **Birds eye viewer**: Detected objects are displayed in a **3D** view with the current point cloud.
- **Image viewer**: Detected objects are displayed in a **2D** view with the current image.
- **Custom detector**: Sample with external detectors to use the DETECTION_MODEL::CUSTOM_BOX_OBJECTS mode
16 changes: 8 additions & 8 deletions object detection/birds eye viewer/python/ogl_viewer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def __add_quad(self, _quad_pts, _alpha1, _alpha2, _clr):
self.indices.append(len(self.indices))

def add_vertical_faces(self, _pts, _clr):
# For each face, we need to add 4 quads (the first 2 indexes are always the top points of the quad)
# For each face, we need to add 4 quads (the first 2 indexes are always the top points of the quad)
quads = [[0, 3, 7, 4] # Front face
, [3, 2, 6, 7] # Right face
, [2, 1, 5, 6] # Back face
Expand Down Expand Up @@ -518,13 +518,13 @@ def updateData(self, pc, _objs):

def create_bbox_rendering(self, _bbox, _bbox_clr):
# First create top and bottom full edges
self.BBox_edges.add_full_edges(_bbox, _bbox_clr)
# Add faded vertical edges
self.BBox_edges.add_vertical_edges(_bbox, _bbox_clr)
# Add faces
self.BBox_faces.add_vertical_faces(_bbox, _bbox_clr)
# Add top face
self.BBox_faces.add_top_face(_bbox, _bbox_clr)
self.BBox_edges.add_full_edges(_bbox, _bbox_clr)
# Add faded vertical edges
self.BBox_edges.add_vertical_edges(_bbox, _bbox_clr)
# Add faces
self.BBox_faces.add_vertical_faces(_bbox, _bbox_clr)
# Add top face
self.BBox_faces.add_top_face(_bbox, _bbox_clr)

def idle(self):
if self.available:
Expand Down
28 changes: 14 additions & 14 deletions object detection/image viewer/python/ogl_viewer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@
GRID_SIZE = 15.0

CLASS_COLORS = np.array([
[44, 117, 255] # People
, [255, 0, 255] # Vehicle
, [0, 0, 255]
[44, 117, 255] # People
, [255, 0, 255] # Vehicle
, [0, 0, 255]
, [0, 255, 255]
, [0, 255, 0]
, [255, 255, 255]]
, np.float32)

ID_COLORS = np.array([
[0.231, 0.909, 0.69]
[0.231, 0.909, 0.69]
, [0.098, 0.686, 0.816]
, [0.412, 0.4, 0.804]
, [1, 0.725, 0]
Expand Down Expand Up @@ -253,7 +253,7 @@ def __add_quad(self, _quad_pts, _alpha1, _alpha2, _clr):
self.indices.append(len(self.indices))

def add_vertical_faces(self, _pts, _clr):
# For each face, we need to add 4 quads (the first 2 indexes are always the top points of the quad)
# For each face, we need to add 4 quads (the first 2 indexes are always the top points of the quad)
quads = [[0, 3, 7, 4] # Front face
, [3, 2, 6, 7] # Right face
, [2, 1, 5, 6] # Back face
Expand Down Expand Up @@ -396,8 +396,8 @@ def draw(self):
layout(location = 0) in vec3 vert;
out vec2 UV;
void main() {
UV = (vert.xy+vec2(1,1))/2;
gl_Position = vec4(vert, 1);
UV = (vert.xy+vec2(1,1))/2;
gl_Position = vec4(vert, 1);
}
"""

Expand Down Expand Up @@ -618,13 +618,13 @@ def update_view(self, _image, _objs): # _objs of type sl.Objects

def create_bbox_rendering(self, _bbox, _bbox_clr):
# First create top and bottom full edges
self.BBox_edges.add_full_edges(_bbox, _bbox_clr)
# Add faded vertical edges
self.BBox_edges.add_vertical_edges(_bbox, _bbox_clr)
# Add faces
self.BBox_faces.add_vertical_faces(_bbox, _bbox_clr)
# Add top face
self.BBox_faces.add_top_face(_bbox, _bbox_clr)
self.BBox_edges.add_full_edges(_bbox, _bbox_clr)
# Add faded vertical edges
self.BBox_edges.add_vertical_edges(_bbox, _bbox_clr)
# Add faces
self.BBox_faces.add_vertical_faces(_bbox, _bbox_clr)
# Add top face
self.BBox_faces.add_top_face(_bbox, _bbox_clr)

def create_id_rendering(self, _center, _clr, _id):
tmp = ObjectClassName()
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial 1 - hello ZED/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ In the console window, you should now see the serial number of the camera (also

To close the camera properly, use zed.close() and exit the program.

```
```python
# Close the camera
zed.close()
return 0
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial 2 - image capture/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ while (i < 50) :

Now that we have captured 50 images, we can close the camera and exit the program.

```
```python
# Close the camera
zed.close()
return 0
Expand Down
10 changes: 4 additions & 6 deletions tutorials/tutorial 3 - depth sensing/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@ Retrieving the depth map is as simple as retrieving an image:
* We create a Mat to store the depth map.
* We call retrieve_measure() to get the depth map.

```
```python
# Capture 50 images and depth, then stop
i = 0
image = sl.Mat()
depth = sl.Mat()
while (i < 50) :
while i < 50 :
# Grab an image
if (zed.grab() == sl.ERROR_CODE.SUCCESS) :
if zed.grab() == sl.ERROR_CODE.SUCCESS :
# A new image is available if grab() returns SUCCESS
zed.retrieve_image(image, sl.VIEW.LEFT) # Get the left image
zed.retrieve_measure(depth, sl.MEASURE.DEPTH) # Retrieve depth Mat. Depth is aligned on the left image
i = i + 1
}
}
```


Expand All @@ -73,7 +71,7 @@ printf("Distance to Camera at (", x, y, "): ", distance, "mm")

Once 50 frames have been grabbed, we close the camera.

```
```python
# Close the camera
zed.close()
```
Expand Down

0 comments on commit 0873d62

Please sign in to comment.