Giter Club home page Giter Club logo

liferay-sightengine's Introduction

liiferay-sightengine

Liferay SightEngine plugin. API service provided by https://sightengine.com/

Abstract

Liferay-sightengine is a liferay tool that allows connection to the api of SightEngine image moderation, image moderation is used to filter images to ultimately accept only the most appropriate images as needed

Tech/framework used

  • This connector has been developed in liferay 7.1.2 CE and works with Sight Engine version 1.0

How To Use

To use the connector just refer to the sightengine service, and then call the function isSafe (...)

The function returns True if the image is considered appropriate otherwise it returns False

Example

		@Reference
		SightEngineService _sightEngineService; // Imported from the Main Class

		File image =new File(Path_to_File);
		try {
			_log.info(_sightEngineService.isSafeImage(image)); // File
			_log.info(_sightEngineService.isSafeImage(Files.readAllBytes(image.toPath()))); // Bytes
			_log.info(_sightEngineService.isSafeImage(new FileInputStream(image))); // Input Stream
			// It will return True if Image is safe else it will return False
		}catch (Exception e) {
			_log.error(e);
		}

Configuration

  • To begin, you have to change the configuration of the project.
  • Mandatory

First of all it is necessary to connect to Sight Engine to have the identifier and the secret key, And Then modify these two fields.

alt ggg

  • Optional

For this connector we worked with the three models (Nudity, Wad, Offensive) to add new models, just modify the configuration file while changing the cardinality according to the number of models used (Of course it is necessary that the models are supported by SightEngine)

image

Finally we put a threshold for each class, if you add new models it will be necessary to add the threshold for this model

image

liferay-sightengine's People

Contributors

ecoquelin avatar achrafzango avatar

Stargazers

钟智强 avatar

Watchers

James Cloos 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.