Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedrorgirardi/djl-clj
https://github.com/pedrorgirardi/djl-clj
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pedrorgirardi/djl-clj
- Owner: pedrorgirardi
- Created: 2020-02-20T11:16:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-08T03:44:37.000Z (almost 5 years ago)
- Last Synced: 2024-11-17T13:49:40.851Z (2 months ago)
- Language: Clojure
- Size: 1.92 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# djl-clj
## Examples
### Single Shot (Object) Detection
```clojure
(with-open [model (load-model :ssd)
predictor (predictor model)]
(let [image (image-from-url (io/resource "soccer.png"))
detections (predict predictor image)]
(ImageVisualization/drawBoundingBoxes image detections)
(ImageIO/write image "png" (File. "ssd.png"))))
```### Bert QA
```clojure
(with-open [model (load-model {:application Application$NLP/QUESTION_ANSWER
:input QAInput
:output String
:progress (progress-bar)
:filter {"backbone" "bert"
"dataset" "book_corpus_wiki_en_uncased"}})
predictor (predictor model)]
(let [input (QAInput.
"When did BBC Japan start broadcasting?"
"BBC Japan was a general entertainment Channel.
Which operated between December 2004 and April 2006.
It ceased operations after its Japanese distributor folded."
384)]
(predict predictor input)));; => "[december, 2004]"
```## Test
```
$ bin/test
```