-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FW: fix fsync for OAK-D-SR * Add tilt projection support * Fixing externally managed environment (#1001) - Added custom error message in addition to "Externally managed environment" to let users know how to solve it - Updated .workflow to always create a separate environment where the depthai will be installed to avoid above error * Install NN blobs from blobconverter (#999) * added thermal_nn to install_requirements * Adding thermal to artifactory Co-authored-by: zrezke <[email protected]> * Fixed two bugs / unexpected behaviours (#1002) * Added bindings for the api. * core * FW: fixes for IMX378 and IMX582: fix concurrent run, fix scaling with IMX378 THE_1352X1012 resolution, change Camera node best sensor config select to prioritize matching aspect ratio * Remove the RH notification * FW: fix default fsync GPIO state for OAK-FFC-4P R7, FSIN_4LANE GPIO42 = input, pull-down. Other depthai-core updates * Develop sync with main (#1004) * Docs/release 25 (#997) * Initial docs update for v2.25 * Added pcl example docs * Adding pointcloud control example * Updating pointcloud example * Added encoded_frame docs (#998) * Added encoded_frame docs * Docs update (#1000) * Update sync_node.rst * Adding USB 3.2Gen2 enable docs --------- Co-authored-by: jakaskerl <[email protected]> * Core v2.25.1 * Fixed FFC3P boot issue. * Update core * Bump core to tagged. --------- Co-authored-by: alex-luxonis <[email protected]> Co-authored-by: SzabolcsGergely <[email protected]> Co-authored-by: jakaskerl <[email protected]> Co-authored-by: Matevz Morato <[email protected]>
- Loading branch information
1 parent
e738ead
commit 4d85750
Showing
7 changed files
with
200 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule depthai-core
updated
12 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import depthai as dai | ||
import cv2 | ||
from pathlib import Path | ||
import numpy as np | ||
import sys | ||
|
||
|
||
nnPath = str((Path(__file__).parent / Path('../models/yolov6n_thermal_people_256x192_openvino_2022.1_6shave.blob')).resolve().absolute()) | ||
if len(sys.argv) > 1: | ||
nnPath = sys.argv[1] | ||
|
||
if not Path(nnPath).exists(): | ||
import sys | ||
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"') | ||
|
||
labels = ["person"] | ||
|
||
device = dai.Device() | ||
|
||
pipeline = dai.Pipeline() | ||
nnet = pipeline.create(dai.node.YoloDetectionNetwork) | ||
nnet.setBlobPath(nnPath) | ||
nnet.setConfidenceThreshold(0.5) | ||
nnet.setNumClasses(1) | ||
nnet.setCoordinateSize(4) | ||
nnet.setIouThreshold(0.4) | ||
|
||
thermalCam = pipeline.create(dai.node.Camera) | ||
thermalCam.setBoardSocket(dai.CameraBoardSocket.CAM_E) | ||
thermalCam.setPreviewSize(256, 192) | ||
|
||
thermalCam.raw.link(nnet.input) | ||
|
||
rawOut = pipeline.createXLinkOut() | ||
rawOut.setStreamName("preview") | ||
thermalCam.preview.link(rawOut.input) | ||
|
||
xoutNn = pipeline.createXLinkOut() | ||
xoutNn.setStreamName("nn") | ||
nnet.out.link(xoutNn.input) | ||
|
||
xoutPass = pipeline.createXLinkOut() | ||
xoutPass.setStreamName("pass") | ||
nnet.passthrough.link(xoutPass.input) | ||
|
||
device.startPipeline(pipeline) | ||
|
||
qNn = device.getOutputQueue(name="nn", maxSize=2, blocking=False) | ||
qPass = device.getOutputQueue(name="pass", maxSize=2, blocking=False) | ||
qPreview = device.getOutputQueue(name="preview", maxSize=2, blocking=False) | ||
|
||
cv2.namedWindow("nnet", cv2.WINDOW_NORMAL) | ||
cv2.namedWindow("raw", cv2.WINDOW_NORMAL) | ||
cv2.resizeWindow("nnet", 640, 480) | ||
cv2.resizeWindow("raw", 640, 480) | ||
|
||
while True: | ||
inNn = qNn.get() | ||
inPass = qPass.tryGet() | ||
inPreview = qPreview.get() | ||
if inNn and inPass: | ||
frame = inPass.getCvFrame().astype(np.float32) | ||
min_, max_ = frame.min(), frame.max() | ||
colormappedFrame = cv2.normalize(frame, None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8U) | ||
colormappedFrame = cv2.applyColorMap(colormappedFrame, cv2.COLORMAP_MAGMA) | ||
|
||
detections = inNn.detections | ||
for detection in detections: | ||
xmin = max(0.0, detection.xmin) | ||
ymin = max(0.0, detection.ymin) | ||
xmax = min(1.0, detection.xmax) | ||
ymax = min(1.0, detection.ymax) | ||
pt1 = int(xmin * 256), int(ymin * 192) | ||
pt2 = int(xmax * 256), int(ymax * 192) | ||
cv2.rectangle(colormappedFrame, pt1, pt2, (0, 255, 0)) | ||
cv2.putText(colormappedFrame, labels[detection.label], pt1, cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2, cv2.LINE_AA) | ||
cv2.imshow("nnet", colormappedFrame) | ||
if inPreview: | ||
cv2.imshow("raw", inPreview.getCvFrame()) | ||
|
||
if cv2.waitKey(1) == ord("q"): | ||
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# MIT License | ||
|
||
# Copyright (c) 2021 Luxonis Holding Corporation | ||
|
||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
|
||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
|
||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
description: >- | ||
thermal-yolo | ||
task_type: object_attributes | ||
files: | ||
- name: yolov6n_thermal_people_256x192_openvino_2022.1_6shave.blob | ||
size: 9311960 | ||
sha256: fb75828e7014ad92170fe54bb3a3253b8be076005bf651ac30eb0841f63a3b86 | ||
source: https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/yolov6n_thermal_people_256x192_openvino_2022.1_6shave.blob | ||
|
||
framework: dldt | ||
license: https://raw.githubusercontent.com/luxonis/depthai-model-zoo/main/LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters