Home

Awesome

origami-dnn

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

New YoloV6

To quickly get started, run one of the following command:

# Yolo v6n
lein yolo.v6cam networks.yolo:yolov6n:1.0
# Yolo v6s
lein yolo.v6cam networks.yolo:yolov6s:1.0
# Yolo v6t
lein yolo.v6cam networks.yolo:yolov6t:1.0
# Yolo v6l
lein yolo.v6cam networks.yolo:yolov6l:1.0

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-repo "networks.tensorflow:tf-ssdmobilenet:1.0.0") ]
    (simple-cam-window
     (read-string (slurp "cam_config.edn"))
     (fn [buffer]
       (-> buffer 
        (find-objects net opts) 
        (d/red-boxes! labels))))))

doc/detected.jpg

AliasFormatNetworkNetwork Origami IDDataSetTypeExample
mobilenet.camcaffemobilenetnetworks.caffe:mobilenet:1.0.0Run mobilenet on a webcam stream
mobilenet.videotofilecaffemobilenetnetworks.caffe:mobilenet:1.0.0Run mobilenet on a video file, and store it as a file
mobilenet.videotoscreencaffemobilenetnetworks.caffe:mobilenet:1.0.0Run mobilenet on a video file, and display the file in a window
mobilenet.onecaffemobilenetnetworks.caffe:mobilenet:1.0.0Run mobilenet on one image and save the picture as a file
yolo.camdarknetYolonetworks.yolo:yolov2-tiny:1.0.0Run yolo on a webcam stream
yolo.onedarknetYolonetworks.yolo:yolov2-tiny:1.0.0Run yolo (tiny) on a picture
yolo.v2darknetYolonetworks.yolo:yolov2:1.0.0Run yolo v2 on a picture
yolo.v2tinydarknetYolonetworks.yolo:yolov2-tiny:1.0.0Run yolo v2 tiny on a picture
yolo.v3darknetYolonetworks.yolo:yolov3:1.0.0Run yolo v3 on a picture
yolo.v3tinydarknetYolonetworks.yolo:yolov3-tiny:1.0.0Run yolo v3 tiny on a picture
yolo.v4darknetYolonetworks.yolo:yolov4:1.0.0Run yolo v4 on a picture
yolo.v6darknetYolonetworks.yolo:yolov6n:1.0Run yolo v6 on a picture
yolo.v6camdarknetYolonetworks.yolo:yolov6n:1.0Run yolo v6 on a cam
yolo.videotoscreendarknetYolonetworks.yolo:yolov2-tiny:1.0.0Run yolo on a video file, and display the file in a window
convnet.gendercaffeConvNetnetworks.caffe:convnet-gender:1.0.0classificationRun convnet on a picture, determine male or female
convnet.agecaffeConvNetnetworks.caffe:convnet-age:1.0.0classificationRun cnet on a picture, determine age
marcelcaffeMobileNetnetworks.caffe:mobilenet:1.0.0detectionRun detection using mobilet on video and display
marcel2caffeMobileNetnetworks.caffe:mobilenet:1.0.0detectionRun detection using mobilenet on video and save to file
bvlccaffeAlexNetnetworks.caffe:bvlc_alexnet:1.0.0classificationRun object classification using bvlc
places365caffenetworks.caffe:places365:1.0.0classificationRun object classification using places365
resnetcaffeResNetnetworks.caffe:resnet:1.0.0classificationRun object classfication using Resnet
cifardarknetnetworks.darknet:cifar-custom:1.0.0classificationClassification using a custom Trained Darknet Model based on cifar
enetdarknetEnetnetworks.darknet:enet-coco:1.0.0Run detection with enet
openimagesdarknetnetwork.darknet:yolo-openimages:1.0.0Run detection with Yolo v3 Trained on OpenImages
flowerscaffenetworks.caffe:flowers:1.0.0Flower detection based on trained oxford102
tensorflow.mobilenettensorflowMobileNetnetworks.tensorflow:tf-ssdmobilenet:1.0.0CocoDetectionOn 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.

Testing networks using the clj command

Create a deps.edn with the following content:

{:mvn/repos
   {"vendredi" {:url "https://repository.hellonico.info/repository/hellonico/"}}
 :deps
   { origami-dnn {:mvn/version "0.1.16"}}}

and run one of the namespaces like shown below:

# Run age detection on a cam
clj -m origami-dnn.demo.agecam
# Run Yolo on a cam
clj -m origami-dnn.demo.yolo.cam
# Run YoloV6 on a cam
clj -m origami-dnn.demo.yolo.v6cam

or start a repl and do the same:

# clj 
(require '[origami-dnn.demo.agecam :as agecam])
(agecam/-main)