Chisle
코딩 에이전트 플러그인, 20개 실시간 작업에서 기본 모델 52% 활용, 간결한 페르소나와 출력 압축 제공
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
NSFW detection on the client-side via TensorFlow.js
README 전체를 불러오는 중입니다.
README 전문 보기 ↗A simple JavaScript library to help you quickly identify unseemly images; all in the client's browser. NSFWJS isn't perfect, but it's pretty accurate (~90% with small and ~93% with midsized model)... and it's getting more accurate all the time.
Why would this be useful? Check out the announcement blog post.
If you're trying to access the Cloudfront hosted model and are running into an error, it's likely due to the fact that the model has been moved to a new location. Please take a look at our Host your own model section. We will be returning the model after some hotlinkers have been dealt with.
The library categorizes image probabilities in the following 5 classes:
Drawing - safe for work drawings (including anime)Hentai - hentai and pornographic drawingsNeutral - safe for work neutral imagesPorn - pornographic images, sexual actsSexy - sexually explicit images, not pornographyThe demo is a continuous deployment source - Give it a go: http://nsfwjs.com
import * as nsfwjs from "nsfwjs";
const img = document.getElementById("img");
// If you want to host models on your own or use different model from the ones available, see the section "Host your own model".
const model = await nsfwjs.load();
// Classify the image
const predictions = await model.classify(img);
console.log("Predictions: ", predictions);
nsfwjs keeps the default behavior and includes built-in model definitions. For selective bundling, import from nsfwjs/core and pass only the models you want in modelDefinitions.
import { load } from "nsfwjs/core";
import { MobileNetV2Model } from "nsfwjs/models/mobilenet_v2";
import { MobileNetV2MidModel } from "nsfwjs/models/mobilenet_v2_mid";
const model = await load("MobileNetV2", {
modelDefinitions: [MobileNetV2Model, MobileNetV2MidModel],
});
If you pass an empty model registry, named bundled model loads will fail:
await load("MobileNetV2", { modelDefinitions: [] }); // throws
load the modelBefore you can classify any image, you'll need to load the model.
const model = nsfwjs.load(); // Default: "MobileNetV2"
You can use the optional first parameter to specify which model you want to use from the three built-in bundled models. Defaults to: "MobileNetV2".
For tree-shaken selective model bundling, use nsfwjs/core and pass modelDefinitions as shown above.
const model = nsfwjs.load("MobileNetV2Mid"); // "MobileNetV2" | "MobileNetV2Mid" | "InceptionV3"
You can also use same parameter and load the model from your website/server, as explained in the Host your own model section. Doing so could reduce the bundle size for loading the model by approximately 1.33 times (33%) since you can directly use the binary files instead of the base64 that are bundled with the package. i.e. The "MobileNetV2" model bundled into the package is 3.5MB instead of 2.6MB for hosted binary files. This would only make a difference if you are loading the model every time (without Caching) on the client-side browser since on the server-side, you'd only be loading the model once at the server start.
If you are hosting your own model via URL and want the smallest app bundle, import load from nsfwjs/core instead of nsfwjs. The core entrypoint does not include built-in model definitions by default, so bundlers do not pull those model assets into your app bundle.
import { load } from "nsfwjs/core";
const model = await load("/path/to/mobilenet_v2/model.json");
Model MobileNetV2 - 224x224
const model = nsfwjs.load("/path/to/mobilenet_v2/");
If you're using a model that needs an image of dimension other than 224x224, you can pass the size in the options parameter.
Model MobileNetV2Mid - Graph
/* You may need to load this model with graph type */
const model = nsfwjs.load("/path/to/mobilenet_v2_mid/", { type: 'graph' });
If you're using a graph model, you cannot use the infer method, and you'll need to tell model load that you're dealing with a graph model in options.
여기까지가 README 앞부분입니다. 나머지는 원문에서 읽을 수 있습니다. README 전문 보기 ↗