Git Product home page Git Product logo

smutminer's Introduction

smutminer

Extract/Score NSFW images from local directory structures. Updated for Tensorflow2 and OpenNSFW2

Install Miniconda

  • curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o Miniconda3-latest-Linux-x86_64.sh
  • bash Miniconda3-latest-Linux-x86_64.sh

Create a conda environment

  • conda create --name opennsfw2 python=3.9
  • conda activate opennsfw2

GPU Setup

  • conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
  • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/
  • mkdir -p $CONDA_PREFIX/etc/conda/activate.d
  • echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh

Install TensorFlow

  • pip install --upgrade pip
  • pip install tensorflow

Install other requirements

Ensure the correct conda environment is activated and run

  • pip install -r requirements.txt

Running

Activate the conda environment you created above

  • conda activate opennsfw2
smutminer.py --help
usage: smutminer.py [-h] [-t THRESHOLD] [-l | --list | --no-list] [-v] [-a | --all | --no-all] {move,copy,link,score} [directory] [output]

positional arguments:
  {move,copy,link,score}
                        Action to take, default: Print the image path and NSFW Score to stdout
  directory             Input Directory. Default: current working directory.
  output                Output Subdirectory. Default: ./nsfw

options:
  -h, --help            show this help message and exit
  -t THRESHOLD, --threshold THRESHOLD
                        Default matching threshold for the open_nsfw model (0 - 1). Default: .7
  -l, --list, --no-list
                        Write a list of original file paths to the output directory
  -v, --verbose         Output verbosity (1-3). Default: Print paths and scores only
  -a, --all, --no-all   Print scores for every image found

smutminer's People

Contributors

pax-humana avatar

Watchers

 avatar

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.