Liking cljdoc? Tell your friends :D

origami-dnn

OpenCV DNN project building on origami to run Tensorflow/Caffe/Darknet networks for image/video real time analysis.

Run origami-dnn on a file

To run detection on a pretrained network, read the image, and call the network detection:

(-> input
    (imread)
    (mobilenet/find-objects net opts)
    (d/blue-boxes! labels)
    (imwrite output))

Run origami-dnn on a stream from camera

(ns origami-dnn.demo.ssdnet.cam
  (:require [origami-dnn.net.mobilenet :refer [find-objects]]
            [origami-dnn.core :as origami-dnn]
            [origami-dnn.draw :as d]
            [opencv4.utils :refer [resize-by simple-cam-window]]))

(defn -main [& args]
  (let [ [net opts labels] (origami-dnn/read-net-from-folder "networks/caffe/mobilenet") ]
    (simple-cam-window
     (read-string (slurp "cam_config.edn"))
     (fn [buffer]
       (-> buffer 
        (find-objects net opts) 
        (d/red-boxes! labels))))))

doc/detected.jpg

AliasFormatNetworkVersionDataSetTypeExample
mobilenet.camcaffemobilenet Run mobilenet on a webcam stream
mobilenet.videotofilecaffemobilenet Run mobilenet on a video file, and store it as a file
mobilenet.videotoscreencaffemobilenet Run mobilenet on a video file, and display the file in a window
mobilenet.onecaffemobilenet Run mobilenet on one image and save the picture as a file
yolo.camdarknetYolo Run yolo on a webcam stream
yolo.onedarknetYolo Run yolo (tiny) on a picture
yolo.v2darknetYolov2 Run yolo v2 on a picture
yolo.v2tinydarknetYolov2.tiny Run yolo v2 tiny on a picture
yolo.v3darknetYolov3 Run yolo v3 on a picture
yolo.v3tinydarknetYolov3.tiny Run yolo v3 tiny on a picture
yolo.videotoscreendarknetYolo Run yolo on a video file, and display the file in a window
yolo.videotofiledarknetYolo Run yolo don a video file, and save the picture as a file
convnet.gendercaffeConvNet classificationRun convnet on a picture, determine male or female
convnet.agecaffeConvNet classificationRun cnet on a picture, determine age
marcelcaffeMobileNet detectionRun detection using mobilet on video and display
marcel2caffeMobileNet detectionRun detection using mobilenet on video and save to file
bvlccaffeAlexNet classificationRun object classification using bvlc
places365caffe classificationRun object classification using places365
resnetcaffeResNet classificationRun object classfication using Resnet
cifardarknet classificationClassification using a custom Trained Darknet Model based on cifar
enetdarknetEnet Run detection with enet
openimagesdarknet Run detection with Yolo v3 Trained on OpenImages
flowerscaffe Flower detection based on trained oxford102
tensorflow.mobilenettensorflowMobileNetV1CocoDetectionOn an image

Marcel le chat

This is a sample output generated on a macbook.

lein run -m  origami-dnn.demo.mobilenet.catvideotofile resources/vids/Marcel.m4v
# or 
lein run -m  origami-dnn.demo.marcel.marcel

or another one ...

Video courtesy of Marcel le chat.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close