Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/276 new script file for testing framework #238

Open
wants to merge 51 commits into
base: develop
Choose a base branch
from

Conversation

rolandoquesada
Copy link
Contributor

No description provided.

rolandoquesada and others added 20 commits October 23, 2024 01:58
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Updating permissions for Results Job to add content: write to pass to CI_Coverage_compare.
    Print out the log files created by the testing
    Update run_all_tests.py to use python3
    Attempt to check if the requirements are installed correctly
@cwlacewe cwlacewe added this to the v2.11.0 Tasks milestone Nov 6, 2024
Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 63.9005%

Target Python Coverage: 98.02%
Source Python Coverage: 98.02%

Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 63.9005%

Target Python Coverage: 98.02%
Source Python Coverage: 98.02%

Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 63.9103%

Target Python Coverage: 97.94%
Source Python Coverage: 97.94%

Copy link
Contributor

Target CPP Coverage: 64.1421%
Source CPP Coverage: 63.8818%

Target Python Coverage: 97.94%
Source Python Coverage: 97.94%

Copy link
Contributor

github-actions bot commented Mar 5, 2025

Target CPP Coverage: 64.2822%
Source CPP Coverage: 64.033%

Target Python Coverage: 97.94%
Source Python Coverage: 97.94%

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Target CPP Coverage: 64.2822%
Source CPP Coverage: 64.0675%

Target Python Coverage: 97.94%
Source Python Coverage: 97.94%

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Target CPP Coverage: 64.2822%
Source CPP Coverage: 64.2075%

Target Python Coverage: 97.94%
Source Python Coverage: 97.94%

@rolandoquesada rolandoquesada marked this pull request as ready for review March 6, 2025 16:50

DEBUG_MODE = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should DEBUG_MODE always be true?

# https://github.com/opencv/opencv/blob/4.x/data/haarcascades/haarcascade_frontalface_default.xml
"functions/files/haarcascade_frontalface_default.xml"
)
DEBUG_MODE = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should DEBUG_MODE be true by default?

@@ -22,6 +22,7 @@ QueryHandlerBase::QueryHandlerBase()
void QueryHandlerBase::cleanup_query(const std::vector<std::string> &images,
const std::vector<std::string> &videos) {
try {
std::cout << "cleanup_query() was called. Size of images: " << images.size() << ", size of videos: " << videos.size() << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove if only added for debug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thank you.

Comment on lines +23 to +27
face_cascade = cv2.CascadeClassifier(
# This file is available from OpenCV 'data' directory at
# https://github.com/opencv/opencv/blob/4.x/data/haarcascades/haarcascade_frontalface_default.xml
haarcascade_frontalface_default_path
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does setting this as a global variable make the tests fail? If not, my thoughts are it may be beneficial to keep it as a global variable.

Comment on lines +21 to +25
face_cascade = cv2.CascadeClassifier(
# This file is available from OpenCV 'data' directory at
# https://github.com/opencv/opencv/blob/4.x/data/haarcascades/haarcascade_frontalface_default.xml
haarcascade_frontalface_default_path
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does setting this as a global variable make the tests fail? If not, my thoughts are it may be beneficial to keep it as a global variable. Any thoughts on this @rv355?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @rolandoquesada moved it inside the function because he is using a dynamic functions directory path. If the plan is to support a dynamic functions directory, we can keep it inside the function, otherwise global would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, exactly. The idea is to support a dynamic functions directory. Thank you.

def set_face_cascade(functions_path):
global face_cascade
haarcascade_frontalface_default_path = os.path.join(
functions_path, "files/haarcascade_frontalface_default.xml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid duplicating this file. Use file located user_defined_operations/functions/files/haarcascade_frontalface_default.xml

EXPECT_EQ(status1, 0);
}

TEST(BLOB, add_Blob) {
Meta_Data *meta_obj = new Meta_Data();
// -blobs.push_back(meta_obj->read_blob(filename));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// -blobs.push_back(meta_obj->read_blob(filename));

Comment on lines +17 to +19
haarcascade_frontalface_default_path = os.path.join(
functions_path, "files/haarcascade_frontalface_default.xml"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use existing file as mentioned previously

Comment on lines +13 to +15
haarcascade_frontalface_default_path = os.path.join(
functions_path, "files/haarcascade_frontalface_default.xml"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use existing file as mentioned previously.

Comment on lines +20 to +24
face_cascade = cv2.CascadeClassifier(
# This file is available from OpenCV 'data' directory at
# https://github.com/opencv/opencv/blob/4.x/data/haarcascades/haarcascade_frontalface_default.xml
haarcascade_frontalface_default_path
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set globally? Mentioned in previous comment



# Function to dynamically import a module given its full path
def import_module_from_path(module_name, path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rolandoquesada, you pointed out the need to include functions and temporary directory paths for the test case remote UDF runs, as we are working with different temporary directory paths. Is it beneficial to do the same in the user-side code? That would mean allowing dynamic function paths and temporary file paths, adding another step for the user. I understand we use default paths, but the warning would suggest using alternate paths. If you think it would be better this way, we must update the wiki accordingly.

socket = context.socket(zmq.REP)
socket.bind("tcp://*:" + str(settings["port"]))
# Function to dynamically import a module given its full path
def import_module_from_path(module_name, path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as for remote functions. If these updates should be included for the user side code, then we should update the wiki accordingly.

frame_height = int(vs.get(4))

video = cv2.VideoWriter(
opfilename, cv2.VideoWriter_fourcc(*"XVID"), 30, (frame_width, frame_height)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm that having XVID fourcc will not cause issues with other file formats such as mp4

frame_height = int(vs.get(4))

video = cv2.VideoWriter(
opfilename, cv2.VideoWriter_fourcc(*"XVID"), 30, (frame_width, frame_height)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm that having XVID fourcc will not cause issues with other file formats such as mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants