Browse Source

Use optimised release for visual haar

testqueue
Ruben van de Ven 2 years ago
parent
commit
16c37ee750
  1. 2
      README.md
  2. 6
      face_recognition/comparison.py
  3. 2
      visualhaar

2
README.md

@ -28,4 +28,4 @@ The installation in Windows can be done, though it is quite elaborate: @@ -28,4 +28,4 @@ The installation in Windows can be done, though it is quite elaborate:
* `cd .\dnn\face_detector`
* `python.exe .\download_weights.py`
* `cd .\visualhaar`
* `cargo build --lib`
* `cargo build --lib --release`

6
face_recognition/comparison.py

@ -344,12 +344,12 @@ def process3_haar(in_q, out_q, cascade_file): @@ -344,12 +344,12 @@ def process3_haar(in_q, out_q, cascade_file):
typedef void* haarclassifier;
haarclassifier classifier_new(char *filename);
void scan_image(haarclassifier, size_t width,size_t height, char *input, char *buffer, size_t length, bool debug);
void scan_image(haarclassifier, size_t width,size_t height, char *input, char *buffer, size_t length, size_t min_face_factor, bool debug);
""")
dir_path = os.path.dirname(os.path.realpath(__file__))
lib_path = os.path.join(dir_path, "..", "visualhaar", "target", "debug")
lib_path = os.path.join(dir_path, "..", "visualhaar", "target", "release")
so_path = os.path.join(lib_path, "libvisual_haarcascades_lib.so")
dll_path = os.path.join(lib_path, "visual_haarcascades_lib.dll")
@ -404,7 +404,7 @@ def process3_haar(in_q, out_q, cascade_file): @@ -404,7 +404,7 @@ def process3_haar(in_q, out_q, cascade_file):
logger.info("Start haar scan")
start = time.time()
C.scan_image(haar, width, height, buffer2, buffer, buffer_len, False)
C.scan_image(haar, width, height, buffer2, buffer, buffer_len, 5, False)
logger.info(f"Visualised scan into buffer: {buffer}")
print(f"duration: {time.time() - start}s")

2
visualhaar

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit 7c7ae29bf9e1390ea304e3708e8f92f6d57f87ff
Subproject commit ac1aea1d68f346be194e64a3275629a177327f2e
Loading…
Cancel
Save