diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 0e3dd4213..6586a9594 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-08T02:45:21","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-09T02:45:07","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/acknowledgements/index.html b/dev/acknowledgements/index.html index 6ab73b797..ab448bf6f 100644 --- a/dev/acknowledgements/index.html +++ b/dev/acknowledgements/index.html @@ -1,2 +1,2 @@ -A Few Acknowledgements · FaceDetection Documentation

Acknowledgements

Thank you to:

  • Simon Honberg for the original open-source Python code upon which this repository is largely based. This has provided me with an easy-to-read and clear foundation for the Julia implementation of this algorithm;
  • Michael Jones for (along with Tirta Susilo) suggesting the method for a facelike-ness measure;
  • Mahdi Rezaei for helping me understand the full process of Viola-Jones' object detection;
  • Ying Bi for always being happy to answer questions (which mainly turned out to be a lack of programming knowledge rather than conceptual; also with help from Bing Xue);
  • Mr. H. Lockwood and Mr. D. Peck are Comp. Sci. students who have answered a few questions of mine;
  • Finally, the people in the Julia slack channel, for dealing with many (probably stupid) questions. Just a few who come to mind: Micket, David Sanders, Eric Forgy, Jakob Nissen, and Roel.
+A Few Acknowledgements · FaceDetection Documentation

Acknowledgements

Thank you to:

  • Simon Honberg for the original open-source Python code upon which this repository is largely based. This has provided me with an easy-to-read and clear foundation for the Julia implementation of this algorithm;
  • Michael Jones for (along with Tirta Susilo) suggesting the method for a facelike-ness measure;
  • Mahdi Rezaei for helping me understand the full process of Viola-Jones' object detection;
  • Ying Bi for always being happy to answer questions (which mainly turned out to be a lack of programming knowledge rather than conceptual; also with help from Bing Xue);
  • Mr. H. Lockwood and Mr. D. Peck are Comp. Sci. students who have answered a few questions of mine;
  • Finally, the people in the Julia slack channel, for dealing with many (probably stupid) questions. Just a few who come to mind: Micket, David Sanders, Eric Forgy, Jakob Nissen, and Roel.
diff --git a/dev/benchmarking/index.html b/dev/benchmarking/index.html index aa884f100..eb2ce15ba 100644 --- a/dev/benchmarking/index.html +++ b/dev/benchmarking/index.html @@ -7,4 +7,4 @@ CPU: Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz WORD_SIZE: 64 LIBM: libopenlibm - LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

1.6 Update

A few months after the release of Julia 1.6, I did some performance considerations (there are already quite a few nice features that come with 1.6). Now these are the benchmarking results (see benchmark/basic.jl) Language of Implementation | Commit | Run Time in Seconds | Number of Allocations | Memory Usage –- | –- | –- | –- | –- Julia | ??? | 8.165 | 249021919 | 5.01 GiB

+ LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

1.6 Update

A few months after the release of Julia 1.6, I did some performance considerations (there are already quite a few nice features that come with 1.6). Now these are the benchmarking results (see benchmark/basic.jl) Language of Implementation | Commit | Run Time in Seconds | Number of Allocations | Memory Usage –- | –- | –- | –- | –- Julia | ??? | 8.165 | 249021919 | 5.01 GiB

diff --git a/dev/caveats/index.html b/dev/caveats/index.html index 116eddd0b..23704cb1c 100644 --- a/dev/caveats/index.html +++ b/dev/caveats/index.html @@ -5,4 +5,4 @@ julia> classifiers = learn(pos_training_path, neg_training_path, num_classifiers, min_feature_height, max_feature_height, min_feature_width, max_feature_width; scale = true, scale_to = (200, 200)) -julia> ensemble_vote_all(pos_testing_path, classifiers, scale = true, scale_to = (200, 200)) +julia> ensemble_vote_all(pos_testing_path, classifiers, scale = true, scale_to = (200, 200)) diff --git a/dev/examples/index.html b/dev/examples/index.html index bf2729571..9fc27b036 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -58,4 +58,4 @@ # print results println("$(string(correct_faces, "/", num_faces)) ($(correct_faces_percent) %) of positive images were correctly identified.") -println("$(string(correct_non_faces, "/", num_non_faces)) ($(correct_non_faces_percent) %) of positive images were correctly identified.") +println("$(string(correct_non_faces, "/", num_non_faces)) ($(correct_non_faces_percent) %) of positive images were correctly identified.") diff --git a/dev/index.html b/dev/index.html index 923bdec5e..8ba7d62ca 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,20 +1,20 @@ Home · FaceDetection Documentation

Home

This is a Julia implementation of Viola-Jones' Object Detection algorithm. Although there is an OpenCV port in Julia, it seems to be ill-maintained. As this algorithm was created for commercial use, there seem to be few widely-used or well-documented implementations of it on GitHub. The implementation this repository is based off is Simon Hohberg's Pythonic repository, as it seems to be well written (and the most starred Python implementation on GitHub, though this is not necessarily a good measure). Julia and Python alike are easy to read and write in — my thinking was that this would be easy enough to replicate in Julia, except for Pythonic classes, where I would have to use structs (or at least easier to replicate from than, for example, C++ or JS — two other highly-starred repositories.).

Important Note

I implore collaboration. I am an undergraduate student with no formal education in computer science (or computer vision of any form for that matter); I am certain this code can be refined/optimised by better programmers than myself. This package is still maturing, and as such there are some things I would still like to implement. Please, help me out if you like!

How it works

In an over-simplified manner, the Viola-Jones algorithm has some four stages:

  1. Takes an image, converts it into an array of intensity values (i.e., in grey-scale), and constructs an Integral Image, such that for every element in the array, the Integral Image element is the sum of all elements above and to the left of it. This makes calculations easier for step 2.
  2. Finds Haar-like Features from Integral Image.
  3. There is now a training phase using sets of faces and non-faces. This phase uses something called Adaboost (short for Adaptive Boosting). Boosting is one method of Ensemble Learning. There are other Ensemble Learning methods like Bagging, Stacking, &c.. The differences between Bagging, Boosting, Stacking are:
    • Bagging uses equal weight voting. Trains each model with a random drawn subset of training set.
    • Boosting trains each new model instance to emphasize the training instances that previous models mis-classified. Has better accuracy comparing to bagging, but also tends to overfit.
    • Stacking trains a learning algorithm to combine the predictions of several other learning algorithms.

Despite this method being developed at the start of the century, it is blazingly fast compared to some machine learning algorithms, and still widely used.

  1. Finally, this algorithm uses Cascading Classifiers to identify faces. (See page 12 of the original paper for the specific cascade).

For a better explanation, read the paper from 2001, or see the Wikipedia page on this algorithm.

Adding FaceDetection.jl

julia> using Pkg
julia> Pkg.add("FaceDetection") Updating registry at `~/.julia/registries/General.toml` Resolving package versions... - Installed CommonWorldInvalidations ─ v1.0.0 - Installed Static ─────────────────── v1.1.1 Installed IfElse ─────────────────── v0.1.1 - Installed StaticArrayInterface ───── v1.8.0 - Installed StatsBase ──────────────── v0.33.21 + Installed Static ─────────────────── v1.1.1 Installed EllipsisNotation ───────── v1.8.0 - Installed Adapt ──────────────────── v4.0.4 + Installed CommonWorldInvalidations ─ v1.0.0 + Installed StaticArrayInterface ───── v1.8.0 + Installed Reactive ───────────────── v0.8.3 + Installed GtkReactive ────────────── v1.0.6 Installed ArrayInterface ─────────── v7.16.0 + Installed Adapt ──────────────────── v4.0.4 + Installed StatsBase ──────────────── v0.33.21 Installed IntervalSets ───────────── v0.5.4 - Installed Reactive ───────────────── v0.8.3 Installed ImageView ──────────────── v0.10.15 - Installed Interpolations ─────────── v0.14.0 - Installed GtkReactive ────────────── v1.0.6 Installed FaceDetection ──────────── v1.1.0 + Installed Interpolations ─────────── v0.14.0 Updating `~/work/FaceDetection.jl/FaceDetection.jl/docs/Project.toml` [00808967] ~ FaceDetection v1.1.0 `~/work/FaceDetection.jl/FaceDetection.jl` ⇒ v1.1.0 ⌅ [86fae568] ↓ ImageView v0.11.7 ⇒ v0.10.15 @@ -38,16 +38,16 @@ ⌅ [2913bbd2] ↓ StatsBase v0.34.3 ⇒ v0.33.21 Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m` Precompiling project... - ✓ IfElse ✓ CommonWorldInvalidations + ✓ IfElse ✓ Adapt ✓ Reactive ✓ Adapt → AdaptStaticArraysExt ✓ Static ✓ ArrayInterface ✓ ArrayInterface → ArrayInterfaceStaticArraysCoreExt - ✓ StatsBase ✓ ArrayInterface → ArrayInterfaceSparseArraysExt + ✓ StatsBase ✓ Interpolations ✓ StaticArrayInterface ✓ StaticArrayInterface → StaticArrayInterfaceOffsetArraysExt @@ -72,7 +72,7 @@ ImageView [86fae568-95e7-573e-a6b2-d8a6b900c9ef] -Failed to precompile ImageView [86fae568-95e7-573e-a6b2-d8a6b900c9ef] to "/home/runner/.julia/compiled/v1.10/ImageView/jl_o8zWq8". +Failed to precompile ImageView [86fae568-95e7-573e-a6b2-d8a6b900c9ef] to "/home/runner/.julia/compiled/v1.10/ImageView/jl_eKXORQ". ERROR: LoadError: InitError: Cannot open display: Stacktrace: [1] error(s::String) @@ -119,4 +119,4 @@ @ stdin:3 during initialization of module Gtk in expression starting at /home/runner/.julia/packages/ImageView/N01cp/src/ImageView.jl:1 -in expression starting at stdin:

Index

+in expression starting at stdin:

Index

diff --git a/dev/resources/index.html b/dev/resources/index.html index 14db5978c..bc25a58e0 100644 --- a/dev/resources/index.html +++ b/dev/resources/index.html @@ -13,4 +13,4 @@ https://www.wikiwand.com/en/List_of_datasets_for_machine-learning_research#/Object_detection_and_recognition https://www.wikiwand.com/en/List_of_datasets_for_machine-learning_research#/Other_images https://www.face-rec.org/databases/ -https://github.com/polarisZhao/awesome-face#-datasets +https://github.com/polarisZhao/awesome-face#-datasets diff --git a/dev/usage/index.html b/dev/usage/index.html index 93663ba6f..e5842d16d 100644 --- a/dev/usage/index.html +++ b/dev/usage/index.html @@ -39,4 +39,4 @@ integral_image_arr::AbstractArray, top_left::Tuple{Int,Int}, bottom_right::Tuple{Int,Int} -) -> Number

Arguments

Returns

source +) -> Number

Arguments

Returns

source