Last updated:
0 purchases
flutter nude checker
Flutter Nude Photo Checker - A Flutter Package for Detecting Nude Images #
The flutter_nude_checker package provides a simple way to detect nude images in Flutter apps. It uses the yahoo open_nsfw model to detect nude images. The model is able to detect nudity with better accuracy.
Features #
Detect nude images in Flutter apps
Detect nudity with GPU acceleration
Detect nudity in images from the internet or from the device's gallery
Installation #
Add this package to your pubspec.yaml file:
dependencies:
flutter_nude_checker: ^1.0.0
copied to clipboard
Run flutter pub get to install the package.
Usage #
Download the tflite model from here and add it to the assets folder of your project. Then, add the following code to your project to detect nude images:
Future<void> _getNSFWScore() async {
final modelPath = await getModelPath("nsfw.tflite");
final picker = ImagePicker();
try {
final XFile? image = await picker.pickImage(source: ImageSource.gallery); // You can also use ImageSource.camera for the camera
if (image != null) {
final nsfwScore =
await FlutterNudeChecker.getNSFWScore(image.path, modelPath);
print("NSFW Score: ${nsfwScore.nsfwScore}");
} else {
print("No image selected.");
}
} catch (e) {
print("Error: $e");
}
}
copied to clipboard
Add the getModelPath function to your project:
Future<String> getModelPath(String assetName) async {
// Get the temporary directory
final tempDir = await getTemporaryDirectory();
// Create a new file in the temporary directory
final file = File('${tempDir.path}/$assetName');
// Write the asset content to the new file
final assetData = await rootBundle.load('assets/$assetName');
final bytes = assetData.buffer.asUint8List();
await file.writeAsBytes(bytes, flush: true);
// Return the file path
return file.path;
}
copied to clipboard
For more detailed usage and customization options, please refer to the documentation.
Contributing #
We welcome contributions! If you have any ideas, bug fixes, or improvements, please open an issue or submit a pull request on our GitHub repository.
TODO #
✅ Add support for Android
❌ Add support for iOS
License #
This package is available under the MIT License. See the LICENSE file for more details.
About #
This package is developed and maintained by MD. SHAHIDUL ISLAM.
If you have any questions or need assistance, feel free to contact us at [email protected].
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.