开源软件名称(OpenSource Name):IBM/MAX-Object-Detector开源软件地址(OpenSource Url):https://github.com/IBM/MAX-Object-Detector开源编程语言(OpenSource Language):Python 76.2%开源软件介绍(OpenSource Introduction):IBM Developer Model Asset Exchange: Object DetectorThis repository contains code to instantiate and deploy an object detection model. This model recognizes the objects present in an image from the 80 different high-level classes of objects in the COCO Dataset. The model consists of a deep convolutional net base model for image feature extraction, together with additional convolutional layers specialized for the task of object detection, that was trained on the COCO data set. The input to the model is an image, and the output is a list of estimated class probabilities for the objects detected in the image. The model is based on the SSD Mobilenet V1 and Faster RCNN ResNet101 object detection model for TensorFlow. The model files are hosted on IBM Cloud Object Storage: ssd_mobilenet_v1.tar.gz and faster_rcnn_resnet101.tar.gz. The code in this repository deploys the model as a web service in a Docker container. This repository was developed as part of the IBM Developer Model Asset Exchange and the public API is powered by IBM Cloud. Model Metadata
References
Licenses
Pre-requisites:
Deployment optionsDeploy from QuayTo run the docker image, which automatically starts the model serving API, run: Intel CPUs: $ docker run -it -p 5000:5000 quay.io/codait/max-object-detector ARM CPUs (eg Raspberry Pi): $ docker run -it -p 5000:5000 quay.io/codait/max-object-detector:arm-arm32v7-latest This will pull a pre-built image from the Quay.io container registry (or use an existing image if already cached locally) and run it. If you'd rather checkout and build the model locally you can follow the run locally steps below. Deploy on Red Hat OpenShiftYou can deploy the model-serving microservice on Red Hat OpenShift by following the instructions for the OpenShift web
console or the OpenShift Container Platform CLI in this tutorial,
specifying Deploy on KubernetesYou can also deploy the model on Kubernetes using the latest docker image on Quay. On your Kubernetes cluster, run the following commands: $ kubectl apply -f https://raw.githubusercontent.com/IBM/MAX-Object-Detector/master/max-object-detector.yaml The model will be available internally at port A more elaborate tutorial on how to deploy this MAX model to production on IBM Cloud can be found here. Deploy on Code EngineYou can also deploy the model on IBM Cloud's Code Engine platform which is based on the Knative serverless framework. Once authenticated with your IBM Cloud account, run the commands below. Create a Code Engine project, give it a unique name $ ibmcloud ce project create --name sandbox Run the container by pointing to the quay.io image and exposting port 5000. $ ibmcloud ce application create --name max-object-detector --image quay.io/codait/max-object-detector --port 5000 Open the resulting URL in a browser, append Run Locally1. Build the ModelClone this repository locally. In a terminal, run the following command: $ git clone https://github.com/IBM/MAX-Object-Detector.git Change directory into the repository base folder: $ cd MAX-Object-Detector To build the docker image locally for Intel CPUs, run: $ docker build -t max-object-detector . To select a model, pass in the $ docker build --build-arg model=faster_rcnn_resnet101 -t max-object-detector . Currently we support two models, For ARM CPUs (eg Raspberry Pi), run: $ docker build -f Dockerfile.arm32v7 -t max-object-detector . All required model assets will be downloaded during the build process. Note that currently this docker image is CPU only (we will add support for GPU images later). 2. Deploy the ModelTo run the docker image, which automatically starts the model serving API, run: $ docker run -it -p 5000:5000 max-object-detector 3. Use the ModelThe API server automatically generates an interactive Swagger documentation page. Go to Use the You can also test it on the command line, for example: $ curl -F "image=@samples/dog-human.jpg" -XPOST http://127.0.0.1:5000/model/predict You should see a JSON response like that below: {
"status": "ok",
"predictions": [
{
"label_id": "1",
"label": "person",
"probability": 0.944034993648529,
"detection_box": [
0.1242099404335022,
0.12507188320159912,
0.8423267006874084,
0.5974075794219971
]
},
{
"label_id": "18",
"label": "dog",
"probability": 0.8645511865615845,
"detection_box": [
0.10447660088539124,
0.17799153923988342,
0.8422801494598389,
0.732001781463623
]
}
]
} You can also control the probability threshold for what objects are returned using the $ curl -F "image=@samples/dog-human.jpg" -XPOST http://127.0.0.1:5000/model/predict?threshold=0.5 The optional 4. Run the NotebookThe demo notebook walks through how to use the model to detect objects in an image and visualize the results. By default, the notebook uses the hosted demo instance, but you can use a locally running instance (see the comments in Cell 3 for details). Note the demo requires Run the following command from the model repo base folder, in a new terminal window: $ jupyter notebook This will start the notebook server. You can launch the demo notebook by clicking on 5. DevelopmentTo run the Flask API app in debug mode, edit 6. CleanupTo stop the Docker container, type Object Detector Web AppThe latest release of the MAX Object Detector Web App is included in the Object Detector docker image. When the model API server is running, the web app can be accessed at If you wish to disable the web app, start the model serving API by running: $ docker run -it -p 5000:5000 -e DISABLE_WEB_APP=true quay.io/codait/max-object-detector Resources and ContributionsIf you are interested in contributing to the Model Asset Exchange project or have any queries, please follow the instructions here. Links
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论