
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@infinitered/react-native-mlkit-image-labeling
Advanced tools
MLKit Image Labeling for React Native with Expo
react-native-mlkit-image-labeling
provides utilities for image classification using ML Kit in React Native apps. It
allows for the classification of images using either ML Kit's built-in models or custom TensorFlow Lite models.
npm install @infinitered/react-native-mlkit-image-labeling expo-asset
import {
useImageLabeling,
useImageLabelingProvider,
useImageLabelingModels,
ImageLabelingConfig,
ClassificationResult
} from "@infinitered/react-native-mlkit-image-labeling";
Create an ImageLabelingConfig
object that identifies your model files and options:
const MODELS: ImageLabelingConfig = {
nsfw: {
model: require("./path/to/model.tflite"),
options: {
maxResultCount: 5,
confidenceThreshold: 0.5,
},
},
};
The image labeling functionality requires a provider at the root of your app or where you plan to use the models:
function App() {
const models = useImageLabelingModels(MODELS);
const { ImageLabelingModelProvider } = useImageLabelingProvider(models);
return (
<ImageLabelingModelProvider>
<YourApp />
</ImageLabelingModelProvider>
);
}
function ImageClassifier() {
// Get the classifier instance for your model
const classifier = useImageLabeling("nsfw");
const classifyImage = async (imageUri: string) => {
try {
const result = await classifier.classifyImage(imageUri);
console.log(result);
} catch (error) {
console.error("Classification failed:", error);
}
};
return (
<View>
// ....your component
</View>
);
}
FAQs
MLKit Image Labeling for React Native with Expo
The npm package @infinitered/react-native-mlkit-image-labeling receives a total of 26 weekly downloads. As such, @infinitered/react-native-mlkit-image-labeling popularity was classified as not popular.
We found that @infinitered/react-native-mlkit-image-labeling demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.