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

Update API #43

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dc77bcd
Add libopenblas
Danile71 Sep 17, 2019
e394049
Add libs
Danile71 Sep 17, 2019
afd8030
Math lib
Danile71 Sep 17, 2019
0ecff40
lgfortran
Danile71 Sep 17, 2019
88ec5d1
Update
Danile71 Feb 11, 2020
d1a82d9
Update
Danile71 Feb 11, 2020
b964c2c
Big update
Danile71 Feb 12, 2020
1c64a8d
Fix memory leak
Danile71 Feb 12, 2020
a5d2435
Add gender
Danile71 Feb 12, 2020
2169ac8
Remove libs
Danile71 Feb 12, 2020
04ab32b
Fix ldconfig
Danile71 Feb 12, 2020
5d94d4c
Add tags
Danile71 Feb 12, 2020
1a45a7f
Add age
Danile71 Feb 12, 2020
f09af14
Revert "Remove libs"
Danile71 Feb 12, 2020
6d607e3
Revert "lgfortran"
Danile71 Feb 12, 2020
df3e603
Revert "Math lib"
Danile71 Feb 12, 2020
544b536
Revert "Add libs"
Danile71 Feb 12, 2020
53e19db
Revert "Add libopenblas"
Danile71 Feb 12, 2020
3caf75f
Rename funcs names
Danile71 Feb 12, 2020
d65b255
Some fixes
Danile71 Feb 12, 2020
c1e5673
Add method RenderFaceDetections
Danile71 Feb 13, 2020
f628381
Fix some bugs
Danile71 Feb 13, 2020
11c1970
Upd
Danile71 Feb 13, 2020
560fa0f
Fix zoom
Danile71 Feb 13, 2020
8ff93ab
Add support cv::Mat grayscale
Danile71 Feb 13, 2020
5616a78
Return sort
Danile71 Feb 13, 2020
8e5e4d5
Update test
Danile71 Feb 13, 2020
99c0cb8
Fix test?
Danile71 Feb 13, 2020
70cd490
Add support custom models
Danile71 May 14, 2020
f007b84
upd
Danile71 May 15, 2020
f827227
add tracking
Danile71 Jun 9, 2020
94728f9
update api
Danile71 Jun 10, 2020
609358f
update api
Danile71 Jun 10, 2020
4820b5b
add go mod
Danile71 Apr 7, 2021
9fe7b40
fix build for mac os
Danile71 Jun 29, 2021
0fa8875
add m1 support
Danile71 Oct 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
.ONESHELL:
.PHONY: all download build sudo_install precommit gofmt-staged testdata

# Should contain src/github.com/Kagami/go-face or tests won't work
# properly (multiple definition of C functions).

# Temporary directory to put files into.
TMP_DIR?=/tmp/

BRANCH?=19.19

export GOPATH = $(PWD)/../../../..

all: test
all: download build sudo_install test clean
precommit: gofmt-staged

gofmt-staged:
Expand All @@ -11,5 +20,27 @@ gofmt-staged:
testdata:
git clone https://github.com/Kagami/go-face-testdata testdata

download:
curl -Lo $(TMP_DIR)dlib.tar.gz https://github.com/davisking/dlib/archive/v${BRANCH}.tar.gz
cd $(TMP_DIR)
tar xf dlib.tar.gz
rm -rf dlib.tar.gz

build:
cd $(TMP_DIR)dlib-${BRANCH}
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DDLIB_JPEG_SUPPORT=ON -DBUILD_SHARED_LIBS=YES -DDLIB_USE_BLAS=ON -DDLIB_USE_LAPACK=ON ..
cmake --build . --config Release -- -j $(nproc --all)

sudo_install:
cd $(TMP_DIR)dlib-${BRANCH}/build
sudo make install
sudo ldconfig

clean:
rm -rf $(TMP_DIR)dlib-${BRANCH}
rm -rf testdata

test: testdata
go test -v
6 changes: 6 additions & 0 deletions cgo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build !arm64,!darwin

package face

// #cgo CXXFLAGS: -std=c++1z -Wall -O3 -DNDEBUG -march=native
import "C"
6 changes: 6 additions & 0 deletions cgo_darwin_arm64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build arm64,darwin

package face

// #cgo CXXFLAGS: -std=c++1z -Wall -O3 -DNDEBUG
import "C"
2 changes: 1 addition & 1 deletion classify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <dlib/graph_utils.h>
#include "classify.h"

int classify(
int classify_(
const std::vector<descriptor>& samples,
const std::vector<int>& cats,
const descriptor& test_sample,
Expand Down
5 changes: 4 additions & 1 deletion classify.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#pragma once
#ifndef CLASSIFY_H
#define CLASSIFY_H

typedef dlib::matrix<float,0,1> descriptor;

int classify(
int classify_(
const std::vector<descriptor>& samples,
const std::vector<int>& cats,
const descriptor& test_sample,
float tolerance
);
#endif /* CLASSIFY_H */
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package face

// #include <stdint.h>
// #include "facerec.h"
// #include "wrapper.h"
import "C"

// An ImageLoadError is returned when provided image file is corrupted.
Expand Down
70 changes: 0 additions & 70 deletions example_test.go

This file was deleted.

Loading