So far, the best C#.NET 9.0 open-source library that uses YOLOv11 with YoloDotNet (Microsoft.ML.OnnxRuntime) powered by a heavily trained ONNX model on a vast NSFW images dataset!
NsfwSharp is the world's first implementation of an ONNX model with YOLOv11 for object detection in C# .NET 9.0, meticulously engineered to detect nudity, inappropriate, and NSFW content with unmatched precision.
- Cutting-Edge Detection: Utilizes YOLOv11 for robust NSFW content detection.
- ONNX Integration: Powered by Microsoft.ML.OnnxRuntime for high performance.
- Modern C# Development: Built exclusively for C# .NET 9.0.
- Extensive Dataset: Trained on an enormous dataset to ensure superior accuracy.
Integrate NsfwSharp into your project by following these simple steps:
-
Clone the Repository:
git clone https://github.com/yourusername/NsfwSharp.git cd NsfwSharp
-
Install Dependencies:
Ensure you have the .NET 9.0 SDK installed. Then, restore NuGet packages:
dotnet restore
-
Install YoloDotNet:
NsfwSharp requires YoloDotNet for YOLOv11 integration. Install it via NuGet:
dotnet add package YoloDotNet
-
Build the Project:
dotnet build
After installation, integrate NSFW detection into your application with ease. Here’s a quick example:
using NsfwSharp;
using SkiaSharp;
using YoloDotNet.Extensions;
public class Program
{
public static void Main()
{
NsfwAnalyzer nsfwAnalyzer = new NsfwAnalyzer(@"yolo_11m_nsfw.onnx");
NsfwAnalysis nsfwAnalysis = nsfwAnalyzer.GetNsfwAnalysis(@"test.jpg");
Console.WriteLine(nsfwAnalysis.Detections[0].Name);
Console.WriteLine(nsfwAnalysis.Detections[0].Confidence);
nsfwAnalysis.DetectionsImage.Save("result.jpg", SKEncodedImageFormat.Jpeg, 100);
}
}
For more detailed examples and documentation, please refer to the Usage Guide.
We welcome contributions from developers and enthusiasts alike! Follow these steps to contribute:
-
Fork the Repository:
Click the Fork button at the top-right of this repository.
-
Create a New Branch:
git checkout -b feature/your-feature-name
-
Make Your Changes:
Commit your modifications with clear and concise commit messages:
git commit -m "Add: [description of your changes]"
-
Push to Your Fork:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Navigate to your fork on GitHub.
- Click the Compare & pull request button.
- Fill in the PR template with details about your changes.
- Submit your pull request.
Your contributions are greatly appreciated and help improve NsfwSharp for everyone!
Encountered a bug or have a feature request? I’d love to hear from you! Please follow these steps:
-
Navigate to the Issues Tab:
Click on the Issues tab in the repository.
-
Create a New Issue:
Click the New Issue button.
-
Fill Out the Issue Template:
Provide a clear title and a detailed description including steps to reproduce the issue.
-
Submit the Issue:
Once submitted, I’ll review and address it as soon as possible.
NsfwSharp is open-sourced under the MIT License. This permissive license allows you to use, modify, and distribute the library with confidence.
A heartfelt thank you goes out to the original author of the pre-trained model. For more details, check out the model on HuggingFace.
For any questions, suggestions, or feedback, please feel free to reach out via GitHub Issues or contact the repository maintainer directly.
Happy coding! 🚀