Re: nnstreamer & openVINO


MyungJoo Ham
 

You're welcome.

 

It'd be great if you could directly send nnstreamer commits or share your examples via Github. You are also welcomed to discuss matters in Github Issues.

 

If you are going to use another library written in C++ or want to keep object oriented principles for potentially bigger projects, C++ is usually a better alternative. That's why a few "sub-plugins" of nnstreamer are written in C++ instead of C; e.g., /ext/nnstreamer/*/*.cc
I'd been a Linux kernel maintainer (, which usually means a C-advocate); however, in many cases the differences of run-time efficiency between C and C++ is either negligable or out-weighted by other software architectural decisions.

 

The example programs are just examples; they cannot cover all the possible usage cases. Thus, in theory, as long as there is at least one example application for a given programming languages, that's enough. :)

 

Anyway, don't worry about your English. It's not my native language, either.

 

Cheers,

MyungJoo

 

 

--------- Original Message ---------

Sender : Olda Šmíd <Olda476@...>

Date : 2021-03-04 16:23 (GMT+9)

Title : Re: [NNStreamer Technical Discuss] nnstreamer & openVINO

 

Thank you very much. That is great help.

I just can't understand why it's better to use c ++ instead of c. As I read your email, just rewrite a few lines and everything will be ok. I always thought that in terms of efficiency, it is best to write a program in the kernel language. When a program is in Python, I run it through another program (python3), which parses my program into c, and only then the action is performed. I still understand c ++ :)
At the same time, there are simply not many programs in the examples in c. Both gstreamer has basic examples in c, but it's already widespread in c ++ or other languages.


I apologize for English - it's not my native language :)

 

čt 4. 3. 2021 v 7:47 odesílatel MyungJoo Ham <myungjoo.ham@...> napsal:

DetectedObject is a simple struct; thus you can keep using it in C.

std :: vector <DetectedObject> is a "dynamic array" of DetectedObject.

You may simply use
   DetectedObject *objects
instead of
   std::vector<DetectedObject> detected_objects
and do memory management yourself.

 

--------- Original Message ---------

Sender : Olda Šmíd <olda476@...>

Date : 2021-03-04 02:18 (GMT+9)

Title : Re: Re: [NNStreamer Technical Discuss] nnstreamer & openVINO

 

I would also like to ask if it is possible to get an example of detection in c?
If I understand correctly, the "error" between c and c ++ is:
   std :: vector <DetectedObject> detected_objects;
The rest I would generally understand how to convert :)

Thank you very much for your help

Olda 

 

út 2. 3. 2021 v 17:29 odesílatel Olda Šmíd <olda476@...> napsal:

Thanks again for the advice. Now nnstreamer reports another error - no myriad plugin is initiated. So I  badly installed the openvino plugin and that's no longer a problem :)

I would like to ask for an example in c. Thank you for the link, I don't really understand it, but hopefully it will be ok.

I'm thinking of trying to rework the image classification example. (https://github.com/nnstreamer/nnstreamer-example/tree/main/native/example_image_classification_tflite). After all, c ++ goes beyond me and as You said, there is no need to use just c++ just because object oriented behavior.

Olda 

 

út 2. 3. 2021 v 12:37 odesílatel MyungJoo Ham <myungjoo.ham@...> napsal:

> so in other words shouldn't I use installation packages other than those from nnstreamer ppa (sudo add-apt-repository ppa: nnstreamer / ppa)?

You may still use packages from other PPAs or locally built libraries; you may need to rebuild nnstreamer subplugins (/ext/nnstreamer/*) accordingly. This is often due to the changes in interfaces of headers or the behaviors of APIs of libraries (e.g., openvino), which implies that they do not keep binary-wise backward-compatibility.

 

You need to keep using all related packages from nnstreamer/ppa ONLY IF you do not want to (potentially) rebuild anything.

 

> I would like to ask more generally - I'm self-learning in programming and I work in c. Why in the examples is just "example_image_classification_tflite" in c and not "object detection"? Is it based on the fact that c is not primarily object-oriented and c ++ is? When I still had an amiga (around 1996 - 2000), I studied BASIC and I had it fixed that even though it is not object-oriented, it is possible to cheat and use objects :)

 

1. Not providing "object detection" example in C has NOTHING to do with C being non object-oriented. You can still write object detection example in C; you just need to slap in an object detection neural network model instead of an image classification model along with proper post processors of your choice. It has totally no relation.

 

2. There are C examples of object detection. Look at https://github.com/nnstreamer/nnstrreamer-example  / Tizen.native/ObjectDetection

 

  Besides, even in the C++ examples of /native directory, if you look closely, you can see that being object-oriented or not has no effect on object detection itself.

 

3. Although the characteristics of programming language has totally NOTHING to do with nerual network models (object detection), if you want object-oriented-like behavior, you may look at GLIB and GOBJECT. (not GLIBC)

 

Cheers,

MyungJoo 

--------- Original Message ---------

Sender : Olda Šmíd <olda476@...>

Date : 2021-03-02 18:05 (GMT+9)

Title : Re: [NNStreamer Technical Discuss] nnstreamer & openVINO

 

Thank you, so in other words shouldn't I use installation packages other than those from nnstreamer ppa (sudo add-apt-repository ppa: nnstreamer / ppa)?

I would like to ask more generally - I'm self-learning in programming and I work in c. Why in the examples is just "example_image_classification_tflite" in c and not "object detection"? Is it based on the fact that c is not primarily object-oriented and c ++ is? When I still had an amiga (around 1996 - 2000), I studied BASIC and I had it fixed that even though it is not object-oriented, it is possible to cheat and use objects :)

út 2. 3. 2021 v 9:26 odesílatel MyungJoo Ham via lists.lfaidata.foundation <myungjoo.ham=samsung.com@...> napsal:

Yes, nnstreamer-openvino in Ubuntu PPA is built against openvino - 2019R3 and to use this instance of nnstreamer-openvino, you are recommended to unstaill your openvino and install openvino from nnstreamer PPA.

If cmake cannot find an openvino installation (probably you are trying "Approach 1"?), you may install openvino.pc (pkgconfig) to help build tools (cmake, meson/ninja) find them. For example, we have added openvino.pc for debian and rpm packaging at https://git.tizen.org/cgit/platform/upstream/dldt/ (/packaging/openvino.pc.in file is processed and packaged). You may edit the .pc.in file and install directly to /usr/lib/pkgconfig/

 

 

 

 

 

 

 

 

Join nnstreamer-technical-discuss@lists.lfaidata.foundation to automatically receive all group messages.