Skip to content

Commit 675891e

Browse files
author
SzabolcsGergely
committed
Change createNodeName to create(dai.Node.NodeName)
1 parent e9b645d commit 675891e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+273
-273
lines changed

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ add_python_example(mono_camera_control MonoCamera/mono_camera_control.py)
149149
## ObjectTracker
150150
add_python_example(object_tracker_video ObjectTracker/object_tracker_video.py)
151151
add_python_example(object_tracker ObjectTracker/object_tracker.py)
152-
add_python_example(spatial_object_tracker_mobilenet ObjectTracker/spatial_object_tracker_mobilenet.py)
152+
add_python_example(spatial_object_tracker ObjectTracker/spatial_object_tracker.py)
153153
# add_python_example(spatial_object_tracker_yolo ObjectTracker/spatial_object_tracker_yolo.py)
154154

155155
## Script

examples/ColorCamera/autoexposure_roi.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@
2424
pipeline = dai.Pipeline()
2525

2626
# Define source and outputs
27-
camRgb = pipeline.createColorCamera()
27+
camRgb = pipeline.create(dai.node.ColorCamera)
2828
camRgb.setPreviewSize(*previewSize)
2929
camRgb.setInterleaved(False)
3030

31-
camControlIn = pipeline.createXLinkIn()
31+
camControlIn = pipeline.create(dai.node.XLinkIn)
3232
camControlIn.setStreamName('camControl')
3333
camControlIn.out.link(camRgb.inputControl)
3434

3535
# Define a neural network that will make predictions based on the source frames
36-
nn = pipeline.createMobileNetDetectionNetwork()
36+
nn = pipeline.create(dai.node.MobileNetDetectionNetwork)
3737
nn.setConfidenceThreshold(0.5)
3838
nn.setBlobPath(nnPath)
3939
nn.setNumInferenceThreads(2)
4040
nn.input.setBlocking(False)
4141
camRgb.preview.link(nn.input)
4242

4343
# Linking
44-
xoutRgb = pipeline.createXLinkOut()
44+
xoutRgb = pipeline.create(dai.node.XLinkOut)
4545
xoutRgb.setStreamName("rgb")
4646
camRgb.preview.link(xoutRgb.input)
4747

48-
nnOut = pipeline.createXLinkOut()
48+
nnOut = pipeline.create(dai.node.XLinkOut)
4949
nnOut.setStreamName("nn")
5050
nn.out.link(nnOut.input)
5151

examples/ColorCamera/rgb_camera_control.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ def clamp(num, v0, v1):
3030
pipeline = dai.Pipeline()
3131

3232
# Define sources and outputs
33-
camRgb = pipeline.createColorCamera()
34-
videoEncoder = pipeline.createVideoEncoder()
35-
stillEncoder = pipeline.createVideoEncoder()
36-
37-
controlIn = pipeline.createXLinkIn()
38-
configIn = pipeline.createXLinkIn()
39-
videoMjpegOut = pipeline.createXLinkOut()
40-
stillMjpegOut = pipeline.createXLinkOut()
41-
previewOut = pipeline.createXLinkOut()
33+
camRgb = pipeline.create(dai.node.ColorCamera)
34+
videoEncoder = pipeline.create(dai.node.VideoEncoder)
35+
stillEncoder = pipeline.create(dai.node.VideoEncoder)
36+
37+
controlIn = pipeline.create(dai.node.XLinkIn)
38+
configIn = pipeline.create(dai.node.XLinkIn)
39+
videoMjpegOut = pipeline.create(dai.node.XLinkOut)
40+
stillMjpegOut = pipeline.create(dai.node.XLinkOut)
41+
previewOut = pipeline.create(dai.node.XLinkOut)
4242

4343
controlIn.setStreamName('control')
4444
configIn.setStreamName('config')

examples/ColorCamera/rgb_preview.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
pipeline = dai.Pipeline()
88

99
# Define source and output
10-
camRgb = pipeline.createColorCamera()
11-
xoutRgb = pipeline.createXLinkOut()
10+
camRgb = pipeline.create(dai.node.ColorCamera)
11+
xoutRgb = pipeline.create(dai.node.XLinkOut)
1212

1313
xoutRgb.setStreamName("rgb")
1414

examples/ColorCamera/rgb_scene.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
# Create pipeline
1111
pipeline = dai.Pipeline()
1212

13-
camRgb = pipeline.createColorCamera()
13+
camRgb = pipeline.create(dai.node.ColorCamera)
1414
camRgb.setIspScale(1,3)
1515

16-
xoutRgb = pipeline.createXLinkOut()
16+
xoutRgb = pipeline.create(dai.node.XLinkOut)
1717
xoutRgb.setStreamName("video")
1818
camRgb.video.link(xoutRgb.input)
1919

20-
camControlIn = pipeline.createXLinkIn()
20+
camControlIn = pipeline.create(dai.node.XLinkIn)
2121
camControlIn.setStreamName("camControl")
2222
camControlIn.out.link(camRgb.inputControl)
2323

examples/ColorCamera/rgb_video.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
pipeline = dai.Pipeline()
88

99
# Define source and output
10-
camRgb = pipeline.createColorCamera()
11-
xoutVideo = pipeline.createXLinkOut()
10+
camRgb = pipeline.create(dai.node.ColorCamera)
11+
xoutVideo = pipeline.create(dai.node.XLinkOut)
1212

1313
xoutVideo.setStreamName("video")
1414

examples/EdgeDetector/edge_detector.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
pipeline = dai.Pipeline()
99

1010
# Define sources and outputs
11-
camRgb = pipeline.createColorCamera()
12-
monoLeft = pipeline.createMonoCamera()
13-
monoRight = pipeline.createMonoCamera()
14-
15-
edgeDetectorLeft = pipeline.createEdgeDetector()
16-
edgeDetectorRight = pipeline.createEdgeDetector()
17-
edgeDetectorRgb = pipeline.createEdgeDetector()
18-
19-
xoutEdgeLeft = pipeline.createXLinkOut()
20-
xoutEdgeRight = pipeline.createXLinkOut()
21-
xoutEdgeRgb = pipeline.createXLinkOut()
22-
xinEdgeCfg = pipeline.createXLinkIn()
11+
camRgb = pipeline.create(dai.node.ColorCamera)
12+
monoLeft = pipeline.create(dai.node.MonoCamera)
13+
monoRight = pipeline.create(dai.node.MonoCamera)
14+
15+
edgeDetectorLeft = pipeline.create(dai.node.EdgeDetector)
16+
edgeDetectorRight = pipeline.create(dai.node.EdgeDetector)
17+
edgeDetectorRgb = pipeline.create(dai.node.EdgeDetector)
18+
19+
xoutEdgeLeft = pipeline.create(dai.node.XLinkOut)
20+
xoutEdgeRight = pipeline.create(dai.node.XLinkOut)
21+
xoutEdgeRgb = pipeline.create(dai.node.XLinkOut)
22+
xinEdgeCfg = pipeline.create(dai.node.XLinkIn)
2323

2424
edgeLeftStr = "edge left"
2525
edgeRightStr = "edge right"

examples/IMU/imu_gyroscope_accelerometer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
pipeline = dai.Pipeline()
1010

1111
# Define sources and outputs
12-
imu = pipeline.createIMU()
13-
xlinkOut = pipeline.createXLinkOut()
12+
imu = pipeline.create(dai.node.IMU)
13+
xlinkOut = pipeline.create(dai.node.XLinkOut)
1414

1515
xlinkOut.setStreamName("imu")
1616

examples/IMU/imu_rotation_vector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
pipeline = dai.Pipeline()
1010

1111
# Define sources and outputs
12-
imu = pipeline.createIMU()
13-
xlinkOut = pipeline.createXLinkOut()
12+
imu = pipeline.create(dai.node.IMU)
13+
xlinkOut = pipeline.create(dai.node.XLinkOut)
1414

1515
xlinkOut.setStreamName("imu")
1616

examples/ImageManip/image_manip_rotate.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@
77
pipeline = dai.Pipeline()
88

99
# Rotate color frames
10-
camRgb = pipeline.createColorCamera()
10+
camRgb = pipeline.create(dai.node.ColorCamera)
1111
camRgb.setPreviewSize(640, 400)
1212
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
1313
camRgb.setInterleaved(False)
1414

15-
manipRgb = pipeline.createImageManip()
15+
manipRgb = pipeline.create(dai.node.ImageManip)
1616
rgbRr = dai.RotatedRect()
1717
rgbRr.center.x, rgbRr.center.y = camRgb.getPreviewWidth() // 2, camRgb.getPreviewHeight() // 2
1818
rgbRr.size.width, rgbRr.size.height = camRgb.getPreviewHeight(), camRgb.getPreviewWidth()
1919
rgbRr.angle = 90
2020
manipRgb.initialConfig.setCropRotatedRect(rgbRr, False)
2121
camRgb.preview.link(manipRgb.inputImage)
2222

23-
manipRgbOut = pipeline.createXLinkOut()
23+
manipRgbOut = pipeline.create(dai.node.XLinkOut)
2424
manipRgbOut.setStreamName("manip_rgb")
2525
manipRgb.out.link(manipRgbOut.input)
2626

2727
# Rotate mono frames
28-
monoLeft = pipeline.createMonoCamera()
28+
monoLeft = pipeline.create(dai.node.MonoCamera)
2929
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
3030
monoLeft.setBoardSocket(dai.CameraBoardSocket.LEFT)
3131

32-
manipLeft = pipeline.createImageManip()
32+
manipLeft = pipeline.create(dai.node.ImageManip)
3333
rr = dai.RotatedRect()
3434
rr.center.x, rr.center.y = monoLeft.getResolutionWidth() // 2, monoLeft.getResolutionHeight() // 2
3535
rr.size.width, rr.size.height = monoLeft.getResolutionHeight(), monoLeft.getResolutionWidth()
3636
rr.angle = 90
3737
manipLeft.initialConfig.setCropRotatedRect(rr, False)
3838
monoLeft.out.link(manipLeft.inputImage)
3939

40-
manipLeftOut = pipeline.createXLinkOut()
40+
manipLeftOut = pipeline.create(dai.node.XLinkOut)
4141
manipLeftOut.setStreamName("manip_left")
4242
manipLeft.out.link(manipLeftOut.input)
4343

0 commit comments

Comments
 (0)