You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to run the project in python multithreading. The total processing time is similar to running in serial. I tried to modify pybind.cpp with pybind11::call_guard pybind11::gil_scoped_release () but no effect. What I've tried:
pybind11::gil_scoped_release release;
const Result r = detector.detectBatch(mats, &detections, flags);
pybind11::gil_scoped_acquire acquire;
Plz consider this issue.
The code I tested with multithreading:
from threading import Thread
ts = time.perf_counter()
num_of_threads = 3
threads = []
for k in range(num_of_threads):
thread = Thread(target=detector.detectBatch, args=[images, ])
threads.append(thread)
thread.start()
for thread in threads:
thread.join()
duration = time.perf_counter() - ts
print("detectBatch()-multithread took:", duration*1000, "milliseconds")
The text was updated successfully, but these errors were encountered:
I try to run the project in python multithreading. The total processing time is similar to running in serial. I tried to modify pybind.cpp with pybind11::call_guard pybind11::gil_scoped_release () but no effect. What I've tried:
Plz consider this issue.
The code I tested with multithreading:
The text was updated successfully, but these errors were encountered: