Use case of Google AI Edge to create TFLite model for Mobile apps use.
Python
2
2 commits
updated Feb 20, 2025
This project provides a comprehensive NSFW (Not Safe For Work) image detection system using multiple AI models and CLIP analysis. It includes tools for converting various NSFW detection models to TFLite format and a scanner utility to analyze directories of images.
$ python -m venv venv
Activate on Linux/Mac
$ source venv/bin/activate
Activate on Windows
$ .\venv\Scripts\activate
Before scanning images, you'll need to convert the models to TFLite format. Run the following conversion scripts:
$ python convert_nsfw_model.py
$ python convert_falconsai_model.py
$ python convert_giacomo_model.py
Each script will download the respective model from HuggingFace and convert it to TFLite format. The converted models will be saved in the current directory.
To scan a directory of images using all available models:
$ python scan_directory.py path/to/image/directory
To use only one model for scanning:
$ python scan_directory.py path/to/image/directory --model-type marqo
Available model types:
marqofalconsaigiacodamarscanTo specify a custom output report location:
$ python scan_directory.py path/to/image/directory --output custom_report.html
The script generates an HTML report in the scanned directory containing:
Use case of Google AI Edge to create TFLite model for Mobile apps use.
Python
2
2 commits
updated Feb 20, 2025
This project provides a comprehensive NSFW (Not Safe For Work) image detection system using multiple AI models and CLIP analysis. It includes tools for converting various NSFW detection models to TFLite format and a scanner utility to analyze directories of images.
$ python -m venv venv
Activate on Linux/Mac
$ source venv/bin/activate
Activate on Windows
$ .\venv\Scripts\activate
Before scanning images, you'll need to convert the models to TFLite format. Run the following conversion scripts:
$ python convert_nsfw_model.py
$ python convert_falconsai_model.py
$ python convert_giacomo_model.py
Each script will download the respective model from HuggingFace and convert it to TFLite format. The converted models will be saved in the current directory.
To scan a directory of images using all available models:
$ python scan_directory.py path/to/image/directory
To use only one model for scanning:
$ python scan_directory.py path/to/image/directory --model-type marqo
Available model types:
marqofalconsaigiacodamarscanTo specify a custom output report location:
$ python scan_directory.py path/to/image/directory --output custom_report.html
The script generates an HTML report in the scanned directory containing: