Skip to content

Commit

Permalink
Merge pull request #13 from stereolabs/sdk_v3.3
Browse files Browse the repository at this point in the history
SDK v3.3
  • Loading branch information
Myzhar authored Nov 27, 2020
2 parents 188f97a + d4fcbc9 commit 54f8707
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GStreamer plugin package for ZED Cameras. The package is composed of several plu

### Windows installation

* Install the latest ZED SDK from the [official download page](https://www.stereolabs.com/developers/release/) [Optional to compile the `zedsrc` plugin to acquire data from a ZED camera device]
* Install the latest ZED SDK v3.3.x from the [official download page](https://www.stereolabs.com/developers/release/) [Optional to compile the `zedsrc` plugin to acquire data from a ZED camera device]
* Install [Git](https://git-scm.com/) or download a ZIP archive
* Install [CMake](https://cmake.org/)
* Install a [GStreamer distribution (**both `runtime` and `development` installers**)](https://gstreamer.freedesktop.org/download/).
Expand All @@ -59,7 +59,7 @@ GStreamer plugin package for ZED Cameras. The package is composed of several plu
#### Install prerequisites
* Install the latest ZED SDK from the [official download page](https://www.stereolabs.com/developers/release/)
* Install the latest ZED SDK v3.3.x from the [official download page](https://www.stereolabs.com/developers/release/)
* Update list of `apt` available packages
Expand Down
8 changes: 6 additions & 2 deletions gst-zed-meta/gstzedmeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ struct _ZedSensors {
};

enum class OBJECT_CLASS {
PERSON = 0, /**< For people detection */
VEHICLE = 1, /**< For vehicles detection. It can be cars, trucks, buses, motorcycles etc */
PERSON = 0,
VEHICLE = 1,
BAG = 2,
ANIMAL = 3,
ELECTRONICS = 4,
FRUIT_VEGETABLE = 5,
LAST
};

Expand Down
27 changes: 26 additions & 1 deletion gst-zed-od-overlay/gstzedodoverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,32 @@ static void draw_objects( cv::Mat& image, guint8 obj_count, ZedObjectData* objs,
double font_scale = 0.75;

std::stringstream txt_info;
txt_info << "Id: " << objs[i].id << " - " << ((objs[i].label==OBJECT_CLASS::PERSON)?"PERSON":"VEHICLE");
txt_info << "Id: " << objs[i].id << " - ";

switch (objs[i].label) {
case OBJECT_CLASS::PERSON:
txt_info << "PERSON";
break;
case OBJECT_CLASS::VEHICLE:
txt_info << "VEHICLE";
break;
case OBJECT_CLASS::ANIMAL:
txt_info << "ANIMAL";
break;
case OBJECT_CLASS::BAG:
txt_info << "BAG";
break;
case OBJECT_CLASS::ELECTRONICS:
txt_info << "ELECTRONICS";
break;
case OBJECT_CLASS::FRUIT_VEGETABLE:
txt_info << "FRUIT_VEGETABLE";
break;
case OBJECT_CLASS::LAST:
default:
txt_info << "UNDEFINED";
break;
}

cv::Size txt_size = cv::getTextSize( txt_info.str(), font_face, font_scale, 1, &baseline );

Expand Down
15 changes: 12 additions & 3 deletions gst-zed-src/gstzedsrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ typedef enum {

typedef enum {
GST_ZEDSRC_OD_MULTI_CLASS_BOX = 0,
GST_ZEDSRC_OD_HUMAN_BODY_FAST = 1,
GST_ZEDSRC_OD_HUMAN_BODY_ACCURATE = 2
GST_ZEDSRC_OD_MULTI_CLASS_BOX_ACCURATE = 1,
GST_ZEDSRC_OD_HUMAN_BODY_FAST = 2,
GST_ZEDSRC_OD_HUMAN_BODY_ACCURATE = 3
} GstZedSrcOdModel;

#define DEFAULT_PROP_CAM_RES static_cast<gint>(sl::RESOLUTION::HD1080)
Expand Down Expand Up @@ -267,6 +268,9 @@ static GType gst_zedtsrc_od_model_get_type (void)
{ GST_ZEDSRC_OD_MULTI_CLASS_BOX,
"Any objects, bounding box based",
"Object Detection Multi class" },
{ GST_ZEDSRC_OD_MULTI_CLASS_BOX_ACCURATE,
"Any objects, bounding box based, state of the art accuracy, requires powerful GPU",
"Object Detection Multi class ACCURATE" },
{ GST_ZEDSRC_OD_HUMAN_BODY_FAST,
"Keypoints based, specific to human skeleton, real time performance even on Jetson or low end GPU cards",
"Skeleton tracking FAST" },
Expand Down Expand Up @@ -871,7 +875,12 @@ static gboolean gst_zedsrc_calculate_caps(GstZedSrc* src)
}

static gboolean gst_zedsrc_start( GstBaseSrc * bsrc )
{
{
#if ZED_SDK_MAJOR_VERSION!=3 && ZED_SDK_MINOR_VERSION!=3
GST_ELEMENT_ERROR (src, LIBRARY, FAILED,
("Wrong ZED SDK version. SDK v3.3.x required "), (NULL));
#endif

GstZedSrc *src = GST_ZED_SRC (bsrc);
sl::ERROR_CODE ret;

Expand Down
6 changes: 6 additions & 0 deletions latest_changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
LATEST CHANGES
==============

ZED SDK v3.3 (2020-11-27)
---------------------
- Add compatibility fix for ZED SDK v3.3
- Add support for multiple OD class
- Add support for MULTICLASS ACCURATE

Release v0.1 (2020-08-24)
--------------------------
- ZED GStreamer package for Linux and Windows
Expand Down
2 changes: 1 addition & 1 deletion scripts/linux/local-od-fps_overlay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# 4) Display the depth stream with FPS info using the `fpsdisplaysink` sink plugin.

gst-launch-1.0 \
zedsrc stream-type=4 resolution=2 framerate=30 od-enabled=true od-detection-model=1 ! \
zedsrc stream-type=4 resolution=2 framerate=30 od-enabled=true od-detection-model=2 ! \
zeddemux name=demux \
demux.src_left ! queue ! zedodoverlay ! queue ! autovideoconvert ! fpsdisplaysink \
demux.src_aux ! queue ! autovideoconvert ! fpsdisplaysink
2 changes: 1 addition & 1 deletion scripts/windows/local-od-fps_overlay.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:: 4) Display the depth stream with FPS info using the `fpsdisplaysink` sink plugin.

gst-launch-1.0 ^
zedsrc stream-type=4 resolution=2 framerate=30 od-enabled=true od-detection-model=1 ! ^
zedsrc stream-type=4 resolution=2 framerate=30 od-enabled=true od-detection-model=2 ! ^
zeddemux name=demux ^
demux.src_left ! queue ! zedodoverlay ! queue ! autovideoconvert ! fpsdisplaysink ^
demux.src_aux ! queue ! autovideoconvert ! fpsdisplaysink

0 comments on commit 54f8707

Please sign in to comment.