Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
readme update 🖊️
  • Loading branch information
GantMan committed Sep 4, 2019
1 parent 6699b05 commit 27dcbd7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Expand Up @@ -24,11 +24,6 @@ The library categorizes image probabilities in the following 5 classes:

The demo is a continuous deployment source - Give it a go: http://nsfwjs.com/

## How to import
For package managers use `npm add nsfwjs` for npm & `yarn add nsfwjs` for yarn. Then `import * as nsfwjs from 'nsfwjs'` to access the library.

For script tags add `<script type="text/javascript" src="https://unpkg.com/nsfwjs"></script>`. Then simply access the `nsfwjs` global variable. This requires that you've already imported TensorFlow.js as well.

## How to use the module

With `async/await` support:
Expand Down Expand Up @@ -156,6 +151,8 @@ $ yarn add @tensorflow/tfjs
$ yarn add nsfwjs
```

For script tags add <script type="text/javascript" src="https://unpkg.com/nsfwjs"></script>. Then simply access the nsfwjs global variable. This requires that you've already imported TensorFlow.js as well.

#### Host your own model

The magic that powers NSFWJS is the [NSFW detection model](https://github.com/gantman/nsfw_model). By default, this node module is pulling from my S3, but I make no guarantees that I'll keep that download link available forever. It's best for the longevity of your project that you download and host your own version of [the model files](https://github.com/infinitered/nsfwjs/tree/master/example/nsfw_demo/public/model). You can then pass the relative URL to your hosted files in the `load` function. If you can come up with a way to bundle the model into the NPM package, I'd love to see a PR to this repo!
Expand Down

0 comments on commit 27dcbd7

Please sign in to comment.