Giter Site home page Giter Site logo

infinitered / nsfwjs-mobile Goto Github PK

View Code? Open in Web Editor NEW
106.0 5.0 23.0 3.74 MB

NSFWjs in React Native

License: MIT License

JavaScript 42.76% Java 13.01% Ruby 11.84% Objective-C 23.22% Starlark 9.18%
machine-learning nsfwjs nsfwjs-mobile tensorflowjs tensorflow-js demo-app react-native-app

nsfwjs-mobile's Introduction

NSFWJS Logo

Client-side indecent content checking

NSFWJS Mobile Demo App

An example React Native implementation of Infinite Red's NSFWjs indecent content checking TensorFlow.js library.

Running the project

  1. Install NPM modules
    npm install
  2. Install Pods
    cd ios && pod install
  3. Compile and run app
    react-native run-ios or react-native run-android

Additional Learning

❤️ Special Thanks ❤️

Thank you to the numerous contributors of NSFWJS and TensorFlowJS. Our awe and appreciation for the friendliness of Open Source is the fuel for all Infinite Red projects like NSFWJS Mobile.

Need the experts? Hire Infinite Red for your next project

If your project's calling for the experts in all things React Native, Infinite Red’s here to help! Our experienced team of software engineers have worked with companies like Microsoft, Zoom, and Mercari to bring even some of the most complex projects to life.

Whether it’s running a full project or training a team on React Native, we can help you solve your company’s toughest engineering challenges – and make it a great experience at the same time. Ready to see how we can work together? Send us a message

nsfwjs-mobile's People

Contributors

dependabot[bot] avatar derekgreenberg avatar kevinvangelder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nsfwjs-mobile's Issues

NSFWJS not working in react native

I installed nsfwjs in react native.
after installation without importing and using app runs but
after:
import * as nsfwjs from 'nsfwjs';
and
await nsfwjs.load()
This error is shown.

`Error: Unable to resolve module path from /Users/muhammadowais/workspace/datingapp/node_modules/get-pixels-frame-info-update/dom-pixels.js: path could not be found within the project or in these directories:
node_modules/get-pixels-frame-info-update/node_modules
node_modules
../../node_modules

If you are sure the module exists, try these steps:

Clear watchman watches: watchman watch-del-all
Delete node_modules and run yarn install
Reset Metro's cache: yarn start --reset-cache
Remove the cache: rm -rf /tmp/metro-*
1 | 'use strict'
2 |
3 | var path = require('path')
| ^
4 | var ndarray = require('ndarray')
5 | var GifReader = require('omggif').GifReader
6 | var pack = require('ndarray-pack')`

[1 ] Then I just installed :
npm install path

Error: Unable to resolve module assert from /Users/muhammadowais/workspace/datingapp/node_modules/gif-encoder/lib/GIFEncoder.js: assert could not be found within the project or in these directories:
node_modules/gif-encoder/node_modules
node_modules
../../node_modules

If you are sure the module exists, try these steps:

Clear watchman watches: watchman watch-del-all
Delete node_modules and run yarn install
Reset Metro's cache: yarn start --reset-cache
Remove the cache: rm -rf /tmp/metro-*
9 | */
10 |
11 | var assert = require('assert');
| ^
12 | var EventEmitter = require('events').EventEmitter;
13 | var ReadableStream = require('readable-stream');
14 | var util = require('util');
at ModuleResolver.resolveDependency (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:234:15)
at DependencyGraph.resolveDependency (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
at Object.resolve (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/lib/transformHelpers.js:317:42)
at resolve (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:629:33)
at /Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:645:26
at Array.reduce ()
at resolveDependencies (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:644:33)
at /Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:329:33
at Generator.next ()
at asyncGeneratorStep (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:24)

[2 ] then I installed:
npm install assert
This error poped.
error: Error: Unable to resolve module stream from /Users/muhammadowais/workspace/datingapp/node_modules/through/index.js: stream could not be found within the project or in these directories:
node_modules
../../node_modules

If you are sure the module exists, try these steps:

Clear watchman watches: watchman watch-del-all
Delete node_modules and run yarn install
Reset Metro's cache: yarn start --reset-cache
Remove the cache: rm -rf /tmp/metro-*
1 | var Stream = require('stream')
| ^
2 |
3 | // through
4 | //
at ModuleResolver.resolveDependency (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:234:15)
at DependencyGraph.resolveDependency (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
at Object.resolve (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/lib/transformHelpers.js:317:42)
at resolve (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:629:33)
at /Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:645:26
at Array.reduce ()
at resolveDependencies (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:644:33)
at /Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:329:33
at Generator.next ()
at asyncGeneratorStep (/Users/muhammadowais/workspace/datingapp/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:24)

[3 ] Then installed:
npm install stream

error: Error: Unable to resolve module events from /Users/muhammadowais/workspace/datingapp/node_modules/gif-encoder/lib/GIFEncoder.js: events could not be found within the project or in these directories:
node_modules/gif-encoder/node_modules
node_modules
../../node_modules

If you are sure the module exists, try these steps:

Clear watchman watches: watchman watch-del-all
Delete node_modules and run yarn install
Reset Metro's cache: yarn start --reset-cache
Remove the cache: rm -rf /tmp/metro-*
10 |
11 | var assert = require('assert');
12 | var EventEmitter = require('events').EventEmitter;
| ^
13 | var ReadableStream = require('readable-stream');
14 | var util = require('util');

[4 ] Intsalled:
npm install events

Error:
error: Error: Unable to resolve module zlib from /Users/muhammadowais/workspace/datingapp/node_modules/pngjs-nozlib/lib/parser-async.js: zlib could not be found within the project or in these directories:
node_modules
../../node_modules

If you are sure the module exists, try these steps:

Clear watchman watches: watchman watch-del-all
Delete node_modules and run yarn install
Reset Metro's cache: yarn start --reset-cache
Remove the cache: rm -rf /tmp/metro-*
2 |
3 | var util = require('util');
4 | var zlib = require('zlib');
| ^
5 | var ChunkStream = require('./chunkstream');
6 | var FilterAsync = require('./filter-parse-async');
7 | var Parser = require('./parser');

[5 ] installed:
npm install zlib

Error:
error: Error: Unable to resolve module ./zlib_bindings from /Users/muhammadowais/workspace/datingapp/node_modules/zlib/lib/zlib.js:

None of these files exist:

node_modules/zlib/lib/zlib_bindings(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.svg|.native.svg|.svg|.ios.bin|.native.bin|.bin)
node_modules/zlib/lib/zlib_bindings/index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.svg|.native.svg|.svg|.ios.bin|.native.bin|.bin)
1 | module.exports = require('./zlib_bindings');
| ^
2 |

NOW I tried installing zlib and adding zlib_bindings in metro.config.js but no lock. there id file at './zlib_bindings' I checked in node_module

if I try to load Model using

import * as tf from '@tensorflow/tfjs';
const modelJson = require('../../../../../../assets/model/model.json');
const modelWeights = require('../../../../../../assets/model/weight.bin');
model = await tf. loadLayersModel(bundleResourceIO(modelJson, modelWeights));
model and weight is downloaded from here:
https://github.com/infinitered/nsfwjs-mobile/blob/master/nsfw-model.json
https://github.com/infinitered/nsfwjs-mobile/blob/master/nsfw-weights.bin

When app starts it gives syntax error in "weight.bin"

Error: FileReader.readAsArrayBuffer is not implemented

Hi @GantMan @kevinvangelder ,

I tried this code in a new react native project but I was getting this error.
I used react-native 0.61.5 and react 16.9.0 to produce this error.

[Unhandled promise rejection: Error: FileReader.readAsArrayBuffer is not implemented]

  • node_modules/react-native/Libraries/Blob/FileReader.js:84:20 in readAsArrayBuffer
  • node_modules/react-native/Libraries/vendor/core/whatwg-fetch.js:220:29 in readBlobAsArrayBuffer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.