mv_machine_learning: drop redundant member variables
authorInki Dae <inki.dae@samsung.com>
Tue, 12 Sep 2023 06:56:10 +0000 (15:56 +0900)
committerKwanghoon Son <k.son@samsung.com>
Wed, 25 Oct 2023 01:54:03 +0000 (10:54 +0900)
[Issue type] : code cleanup

Drop a redundant member variables from ObjectDetectionInput and
AsyncInputQueue structures. The member variables - handle, inference_src,
and user_data - aren't used anymore.

Change-Id: Iecd39cb8ca0f2cafdfd09b792bdcbe9cca72ca8b
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/common/include/async_manager.h
mv_machine_learning/common/src/async_manager.cpp
mv_machine_learning/object_detection/include/object_detection_type.h
mv_machine_learning/object_detection/src/mv_face_detection.cpp
mv_machine_learning/object_detection/src/mv_object_detection.cpp
mv_machine_learning/object_detection/src/object_detection.cpp

index 6eea9dc..ed33d1b 100644 (file)
@@ -33,10 +33,7 @@ namespace machine_learning
 {
 template<typename T> struct AsyncInputQueue {
        unsigned long frame_number {};
-       void *handle {};
-       mv_source_h inference_src;
        std::vector<std::vector<T> > inputs;
-       void *user_data {};
 };
 
 template<typename R> class AsyncManager
index 5c8cad0..95865c9 100644 (file)
@@ -68,9 +68,6 @@ template<typename R> template<typename T> void AsyncManager<R>::pushToInput(Asyn
        AsyncInputQueue<unsigned char> dstQueue;
 
        dstQueue.frame_number = inputQueue.frame_number;
-       dstQueue.handle = inputQueue.handle;
-       dstQueue.inference_src = inputQueue.inference_src;
-       dstQueue.user_data = inputQueue.user_data;
 
        for (auto &elms : inputQueue.inputs) {
                vector<unsigned char> dst_vector;
@@ -97,9 +94,6 @@ template<typename R> template<typename T> AsyncInputQueue<T> AsyncManager<R>::po
        AsyncInputQueue<T> dstQueue;
 
        dstQueue.frame_number = inputQueue.frame_number;
-       dstQueue.handle = inputQueue.handle;
-       dstQueue.inference_src = inputQueue.inference_src;
-       dstQueue.user_data = inputQueue.user_data;
 
        for (auto &elms : inputQueue.inputs) {
                vector<T> dst_vector;
index 9777a25..2844dfd 100644 (file)
@@ -28,7 +28,6 @@ namespace mediavision
 namespace machine_learning
 {
 struct ObjectDetectionInput {
-       void *handle {};
        mv_source_h inference_src;
        // TODO.
 };
index ce3e90e..35b2b59 100644 (file)
@@ -324,7 +324,7 @@ int mv_face_detection_inference_async(mv_face_detection_h handle, mv_source_h so
                auto context = static_cast<Context *>(handle);
                auto task = static_cast<FaceDetectionTask *>(context->__tasks.at("face_detection"));
 
-               ObjectDetectionInput input = { handle, source };
+               ObjectDetectionInput input = { source };
 
                task->performAsync(input);
        } catch (const BaseException &e) {
index 29c20da..e90696a 100644 (file)
@@ -317,7 +317,7 @@ int mv_object_detection_inference_async(mv_object_detection_h handle, mv_source_
                auto context = static_cast<Context *>(handle);
                auto task = static_cast<ObjectDetectionTask *>(context->__tasks.at("object_detection"));
 
-               ObjectDetectionInput input = { handle, source };
+               ObjectDetectionInput input = { source };
 
                task->performAsync(input);
        } catch (const BaseException &e) {
index 62f6513..c956e57 100644 (file)
@@ -383,7 +383,7 @@ template<typename T> void ObjectDetection::performAsync(ObjectDetectionInput &in
        preprocess<T>(input.inference_src, metaInfo, inputVector);
 
        vector<vector<T> > inputVectors = { inputVector };
-       AsyncInputQueue<T> in_queue = { _input_frame_number, input.handle, input.inference_src, inputVectors };
+       AsyncInputQueue<T> in_queue = { _input_frame_number, inputVectors };
 
        _async_manager->pushToInput<T>(in_queue);