[PAID] Integrate Google Cloud Vistion API into upload process

AI-generated summary

The discussion is about integrating the Google Cloud Vision API into the Discourse upload process. Terrapop proposes a plugin that utilizes the API to check uploaded images and reject those with disallowed content. The plugin would hook into the main image upload process and allow for configurable minimum likelihoods for various flag categories (Adult, Spoof, Medical, Violence, Racy). The plugin should also instantly remove rejected images without saving them. The Google Cloud Vision API supports various image formats, and Terrapop has provided relevant documentation and resources. fzngagan has given Terrapop the go-ahead to proceed with the project.

A plugin that checks all images uploaded to Discourse via the Google Cloud Vision API and rejects if not appropriate according to set levels.

Documentation:

A Ruby Gem is provided by Google:

This plugin should hook into the main image upload process of Discourse for all images (posts, avatars, profile backgrounds etc.) and reject images that contain disallowed content:

  puts "Adult:    #{safe_search.adult}"  puts "Spoof:    #{safe_search.spoof}"  puts "Medical:  #{safe_search.medical}"  puts "Violence: #{safe_search.violence}"  puts "Racy:     #{safe_search.racy}"
['UNKNOWN', 'VERY_UNLIKELY', 'UNLIKELY',        'POSSIBLE', 'LIKELY', 'VERY_LIKELY']

The min likelihoods to reject uploads for the various flag categories (Adult, Sppor, Medical, Violence, Racy) should be configurable in the plugin settings.

Rejected images should be removed instantly and don’t be saved anywhere.

Supported image formats by Google Cloud Vision:

2 Likes

Thanks. @Terrapop has gone ahead with me on this.

7 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.