Use smaller capture size for mobile
This commit is contained in:
parent
4873a76a83
commit
81896ba400
1 changed files with 4 additions and 2 deletions
|
|
@ -70,6 +70,7 @@
|
||||||
(set! (.-onloadedmetadata video-elem) #(resolve video-elem)))))
|
(set! (.-onloadedmetadata video-elem) #(resolve video-elem)))))
|
||||||
|
|
||||||
;; TODO: Handle rejected permission request
|
;; TODO: Handle rejected permission request
|
||||||
|
;; TODO: Initialize model in the background
|
||||||
|
|
||||||
(defn init []
|
(defn init []
|
||||||
(swap! state ::status :webcam-init)
|
(swap! state ::status :webcam-init)
|
||||||
|
|
@ -85,8 +86,7 @@
|
||||||
;; initialize canvas
|
;; initialize canvas
|
||||||
(set! (.-width canvas) (.-videoWidth video))
|
(set! (.-width canvas) (.-videoWidth video))
|
||||||
(set! (.-height canvas) (.-videoHeight video))
|
(set! (.-height canvas) (.-videoHeight video))
|
||||||
#_(.translate ctx (.-width canvas) 0)
|
#_(.scale ctx (/ (.-clientWidth video) (.-videoWidth video)) (/ (.-clientHeight video) (.-videoHeight video)))
|
||||||
#_(.scale ctx -1 1)
|
|
||||||
|
|
||||||
;; initalize model
|
;; initalize model
|
||||||
(swap! state ::status :model-init)
|
(swap! state ::status :model-init)
|
||||||
|
|
@ -95,6 +95,8 @@
|
||||||
(then #(.load facemesh #js {:maxFaces 1}))
|
(then #(.load facemesh #js {:maxFaces 1}))
|
||||||
(then #(detect-faces % video))))))))
|
(then #(detect-faces % video))))))))
|
||||||
|
|
||||||
|
(.-clientWidth (.querySelector js/document "video#capture"))
|
||||||
|
|
||||||
(defonce initialize (init)
|
(defonce initialize (init)
|
||||||
#_(do
|
#_(do
|
||||||
(println "Initializing…")
|
(println "Initializing…")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue