Giter VIP home page Giter VIP logo

geckomomahdy / inference Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roboflow/inference

0.0 0.0 0.0 59.02 MB

A fast, easy-to-use, production-ready inference server for computer vision supporting deployment of many popular model architectures and fine-tuned models.

Home Page: https://inference.roboflow.com

License: Other

Shell 0.40% JavaScript 0.01% Python 96.76% TypeScript 0.77% CSS 0.04% Makefile 0.10% HTML 1.44% Smarty 0.08% Roff 0.19% Slim 0.20%

inference's Introduction

๐Ÿ‘‹ hello

Roboflow Inference is an open-source platform designed to simplify the deployment of computer vision models. It enables developers to perform object detection, classification, and instance segmentation and utilize foundation models like CLIP, Segment Anything, and YOLO-World through a Python-native package, a self-hosted inference server, or a fully managed API.

Explore our enterprise options for advanced features like server deployment, device management, active learning, and commercial licenses for YOLOv5 and YOLOv8.

๐Ÿ’ป install

Inference package requires Python>=3.8,<=3.11. Click here to learn more about running Inference inside Docker.

pip install inference
๐Ÿ‘‰ additional considerations
  • hardware

    Enhance model performance in GPU-accelerated environments by installing CUDA-compatible dependencies.

    pip install inference-gpu
  • models

    The inference and inference-gpu packages install only the minimal shared dependencies. Install model-specific dependencies to ensure code compatibility and license compliance. Learn more about the models supported by Inference.

    pip install inference[yolo-world]

๐Ÿ”ฅ quickstart

Use Inference SDK to run models locally with just a few lines of code. The image input can be a URL, a numpy array (BGR), or a PIL image.

from inference import get_model

model = get_model(model_id="yolov8n-640")

results = model.infer("https://media.roboflow.com/inference/people-walking.jpg")
๐Ÿ‘‰ roboflow models

Set up your ROBOFLOW_API_KEY to access thousands of fine-tuned models shared by the Roboflow Universe community and your custom model. Navigate to ๐Ÿ”‘ keys section to learn more.

from inference import get_model

model = get_model(model_id="soccer-players-5fuqs/1")

results = model.infer(
    image="https://media.roboflow.com/inference/soccer.jpg",
    confidence=0.5,
    iou_threshold=0.5
)
๐Ÿ‘‰ foundational models
  • CLIP Embeddings - generate text and image embeddings that you can use for zero-shot classification or assessing image similarity.

    from inference.models import Clip
    
    model = Clip()
    
    embeddings_text = clip.embed_text("a football match")
    embeddings_image = model.embed_image("https://media.roboflow.com/inference/soccer.jpg")
  • Segment Anything - segment all objects visible in the image or only those associated with selected points or boxes.

    from inference.models import SegmentAnything
    
    model = SegmentAnything()
    
    result = model.segment_image("https://media.roboflow.com/inference/soccer.jpg")
  • YOLO-World - an almost real-time zero-shot detector that enables the detection of any objects without any training.

    from inference.models import YOLOWorld
    
    model = YOLOWorld(model_id="yolo_world/l")
    
    result = model.infer(
        image="https://media.roboflow.com/inference/dog.jpeg",
        text=["person", "backpack", "dog", "eye", "nose", "ear", "tongue"],
        confidence=0.03
    )

๐Ÿ“Ÿ inference server

  • deploy server

    The inference server is distributed via Docker. Behind the scenes, inference will download and run the image that is appropriate for your hardware. Here, you can learn more about the supported images.

    inference server start
  • run client

    Consume inference server predictions using the HTTP client available in the Inference SDK.

    from inference_sdk import InferenceHTTPClient
    
    client = InferenceHTTPClient(
        api_url="http://localhost:9001",
        api_key=<ROBOFLOW_API_KEY>
    )
    with client.use_model(model_id="soccer-players-5fuqs/1"):
        predictions = client.infer("https://media.roboflow.com/inference/soccer.jpg")

    If you're using the hosted API, change the local API URL to https://detect.roboflow.com. Accessing the hosted inference server and/or using any of the fine-tuned models require a ROBOFLOW_API_KEY. For further information, visit the ๐Ÿ”‘ keys section.

๐ŸŽฅ inference pipeline

The inference pipeline is an efficient method for processing static video files and streams. Select a model, define the video source, and set a callback action. You can choose from predefined callbacks that allow you to display results on the screen or save them to a file.

from inference import InferencePipeline
from inference.core.interfaces.stream.sinks import render_boxes

pipeline = InferencePipeline.init(
    model_id="yolov8x-1280",
    video_reference="https://media.roboflow.com/inference/people-walking.mp4",
    on_prediction=render_boxes
)

pipeline.start()
pipeline.join()

๐Ÿ”‘ keys

Inference enables the deployment of a wide range of pre-trained and foundational models without an API key. To access thousands of fine-tuned models shared by the Roboflow Universe community, configure your API key.

export ROBOFLOW_API_KEY=<YOUR_API_KEY>

๐Ÿ“š documentation

Visit our documentation to explore comprehensive guides, detailed API references, and a wide array of tutorials designed to help you harness the full potential of the Inference package.

ยฉ license

The Roboflow Inference code is distributed under the Apache 2.0 license. However, each supported model is subject to its licensing. Detailed information on each model's license can be found here.

๐Ÿ† contribution

We would love your input to improve Roboflow Inference! Please see our contributing guide to get started. Thank you to all of our contributors! ๐Ÿ™


inference's People

Contributors

artemwheat avatar artyaltanzaya avatar bigbitbus avatar capjamesg avatar chandlersupple avatar dependabot[bot] avatar github-actions[bot] avatar grzegorz-roboflow avatar hansent avatar hvaria avatar jchens avatar josephofiowa avatar kresetar avatar onuralpszr avatar pacificdou avatar paulguerrie avatar pawelpeczek-roboflow avatar probicheaux avatar robiscoding avatar ryanjball avatar sberan avatar shingomatsuura avatar skalskip avatar skylargivens avatar solomonlake avatar stellasphere avatar tonylampada avatar yeldarby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.