Remove unused code
This commit is contained in:
parent
81896ba400
commit
3d2075764a
1 changed files with 5 additions and 36 deletions
|
|
@ -12,38 +12,15 @@
|
|||
(.clearRect ctx 0 0 (.. ctx -canvas -width) (.. ctx -canvas -height))
|
||||
|
||||
;; draw and append new results
|
||||
|
||||
(set! (.-strokeStyle ctx) "pink")
|
||||
(doseq [prediction predictions
|
||||
:let [[[t-x t-y]] (j/get-in prediction [:boundingBox :topLeft])
|
||||
[[b-x b-y]] (j/get-in prediction [:boundingBox :bottomRight])]]
|
||||
(set! (.-strokeStyle ctx) "pink")
|
||||
|
||||
(comment
|
||||
(.setLineDash ctx #js [2 2])
|
||||
|
||||
(.beginPath ctx)
|
||||
(.moveTo ctx t-x t-y)
|
||||
(.lineTo ctx t-x b-y)
|
||||
(.lineTo ctx b-x b-y)
|
||||
(.lineTo ctx b-x t-y)
|
||||
(.lineTo ctx t-x t-y)
|
||||
(.stroke ctx)
|
||||
|
||||
(.setLineDash ctx #js [])
|
||||
(.beginPath ctx)
|
||||
(.arc ctx b-x b-y 2 0 (* 2 Math/PI))
|
||||
(.stroke ctx))
|
||||
|
||||
(doseq [[x y _] (j/get prediction :scaledMesh)]
|
||||
(.beginPath ctx)
|
||||
(.arc ctx x y 1 0 (* 2 Math/PI))
|
||||
(.stroke ctx))
|
||||
|
||||
(comment
|
||||
(doseq [[x y _] (j/get prediction :mesh)]
|
||||
(.beginPath ctx)
|
||||
(.arc ctx x y 2 0 (* 2 Math/PI))
|
||||
(.stroke ctx))))))
|
||||
(.stroke ctx)))))
|
||||
|
||||
(defn detect-faces [model elem]
|
||||
(.. model
|
||||
|
|
@ -73,10 +50,10 @@
|
|||
;; TODO: Initialize model in the background
|
||||
|
||||
(defn init []
|
||||
(println "Initializing…")
|
||||
(swap! state ::status :webcam-init)
|
||||
(let [video (.querySelector js/document "video#capture")
|
||||
canvas (.querySelector js/document "canvas#result")
|
||||
ctx (.getContext canvas "2d")]
|
||||
canvas (.querySelector js/document "canvas#result")]
|
||||
(-> (start-capture video)
|
||||
(.then (fn [video]
|
||||
(.play video)
|
||||
|
|
@ -95,12 +72,4 @@
|
|||
(then #(.load facemesh #js {:maxFaces 1}))
|
||||
(then #(detect-faces % video))))))))
|
||||
|
||||
(.-clientWidth (.querySelector js/document "video#capture"))
|
||||
|
||||
(defonce initialize (init)
|
||||
#_(do
|
||||
(println "Initializing…")
|
||||
(.. tf
|
||||
(setBackend "webgl")
|
||||
(then #(.load facemesh #js {:maxFaces 1}))
|
||||
(then detect-faces))))
|
||||
(defonce initialize (init))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue