Skip to content

Commit

Permalink
began work on parsing xml data (for #20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewilliami committed Sep 28, 2020
1 parent 5b62afa commit e6cef5a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
33 changes: 33 additions & 0 deletions examples/read_xml.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
#=
exec julia --project="$(realpath $(dirname $0))/" "${BASH_SOURCE[0]}" "$@" -e "include(popfirst!(ARGS))" \
"${BASH_SOURCE[0]}" "$@"
=#

println("\033[1;34m===>\033[0;38m\033[1;38m\tLoading required libraries (it will take a moment to precompile if it is your first time doing this)...\033[0;38m")

include(joinpath(dirname(dirname(@__FILE__)), "src", "FaceDetection.jl"))

using .FaceDetection
const FD = FaceDetection
using Images: imresize
using StatsPlots # StatsPlots required for box plots # plot boxplot @layout :origin savefig
using CSV: write
using DataFrames: DataFrame
using HypothesisTests: UnequalVarianceTTest
using LightXML

println("...done")

function main()
xml_data = parse_file(joinpath(dirname(dirname(@__FILE__)), "data", "haarcascades", "haarcascade_frontalface_default.xml")) # ../data/haarcascades/haarcascade_frontalface_default.xml

for c in child_nodes(root(xml_data)) # c is an instance of XMLNode
if is_elementnode(c)
e = XMLElement(c) # this makes an XMLElement instance
println(name(e))
end
end
end

main()
8 changes: 4 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ main() {

if [[ "$(whoami)" == "jakeireland" && "$(uname -s)" == "Darwin" ]]
then
# obtainDatasetMain
# obtainDatasetAlt
# obtainLabelledFacesInTheWildDataset
# collateAllNonFaces
obtainDatasetMain
obtainDatasetAlt
openCVPreTrained
obtainLabelledFacesInTheWildDataset
collateAllNonFaces
else
main
fi

0 comments on commit e6cef5a

Please sign in to comment.