adirik / codet
Detects objects in an image
Prediction
adirik/codet:a671251d28c23a1a476ecfe2e0e4924d49d8141d318eb7fe938b2dcdec952fddIDosnb6b3b3bakfmu7jucszlrvwyStatusSucceededSourceWebHardwareA40Total durationCreatedInput
{ "image": "https://replicate.delivery/pbxt/JtQteKssPB1rIll144OqsX4FDuQ2pih89jOAE8MZ3QnPx8Dw/1.jpeg", "confidence": 0.5, "show_visualisation": true }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run adirik/codet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "adirik/codet:a671251d28c23a1a476ecfe2e0e4924d49d8141d318eb7fe938b2dcdec952fdd", { input: { image: "https://replicate.delivery/pbxt/JtQteKssPB1rIll144OqsX4FDuQ2pih89jOAE8MZ3QnPx8Dw/1.jpeg", confidence: 0.5, show_visualisation: true } } ); // To access the file URL: console.log(output[0].url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run adirik/codet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "adirik/codet:a671251d28c23a1a476ecfe2e0e4924d49d8141d318eb7fe938b2dcdec952fdd", input={ "image": "https://replicate.delivery/pbxt/JtQteKssPB1rIll144OqsX4FDuQ2pih89jOAE8MZ3QnPx8Dw/1.jpeg", "confidence": 0.5, "show_visualisation": True } ) # To access the file URL: print(output[0].url()) #=> "http://example.com" # To write the file to disk: with open("my-image.png", "wb") as file: file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
Run adirik/codet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "adirik/codet:a671251d28c23a1a476ecfe2e0e4924d49d8141d318eb7fe938b2dcdec952fdd", "input": { "image": "https://replicate.delivery/pbxt/JtQteKssPB1rIll144OqsX4FDuQ2pih89jOAE8MZ3QnPx8Dw/1.jpeg", "confidence": 0.5, "show_visualisation": true } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2023-11-17T14:15:12.945959Z", "created_at": "2023-11-17T14:13:33.891240Z", "data_removed": false, "error": null, "id": "osnb6b3b3bakfmu7jucszlrvwy", "input": { "image": "https://replicate.delivery/pbxt/JtQteKssPB1rIll144OqsX4FDuQ2pih89jOAE8MZ3QnPx8Dw/1.jpeg", "confidence": 0.5, "show_visualisation": true }, "logs": "[11/17 14:15:00 d2.checkpoint.detection_checkpoint]: [DetectionCheckpointer] Loading from checkpoints/CoDet_OVLVIS_SwinB_4x_ft4x.pth ...\n[11/17 14:15:00 fvcore.common.checkpoint]: [Checkpointer] Loading from checkpoints/CoDet_OVLVIS_SwinB_4x_ft4x.pth ...\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.cls_score.zs_weight' to the model due to incompatible shapes: (512, 5910) in the checkpoint but (512, 4707) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.fc1.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.fc1.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.fc2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.weight_transform.0.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.weight_transform.0.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.weight_transform.2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.cls_score.zs_weight' to the model due to incompatible shapes: (512, 5910) in the checkpoint but (512, 4707) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.fc1.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.fc1.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.fc2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.weight_transform.0.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.weight_transform.0.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.weight_transform.2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.cls_score.zs_weight' to the model due to incompatible shapes: (512, 5910) in the checkpoint but (512, 4707) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.fc1.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.fc1.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.fc2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.weight_transform.0.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.weight_transform.0.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.weight_transform.2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected.\nWARNING [11/17 14:15:01 fvcore.common.checkpoint]: Some model parameters or buffers are not found in the checkpoint:\nroi_heads.box_predictor.0.cls_score.{detection_weight, zs_weight}\nroi_heads.box_predictor.0.fc1.{bias, weight}\nroi_heads.box_predictor.0.fc2.weight\nroi_heads.box_predictor.0.weight_transform.0.{bias, weight}\nroi_heads.box_predictor.0.weight_transform.2.weight\nroi_heads.box_predictor.1.cls_score.{detection_weight, zs_weight}\nroi_heads.box_predictor.1.fc1.{bias, weight}\nroi_heads.box_predictor.1.fc2.weight\nroi_heads.box_predictor.1.weight_transform.0.{bias, weight}\nroi_heads.box_predictor.1.weight_transform.2.weight\nroi_heads.box_predictor.2.cls_score.{detection_weight, zs_weight}\nroi_heads.box_predictor.2.fc1.{bias, weight}\nroi_heads.box_predictor.2.fc2.weight\nroi_heads.box_predictor.2.weight_transform.0.{bias, weight}\nroi_heads.box_predictor.2.weight_transform.2.weight", "metrics": { "predict_time": 17.117461, "total_time": 99.054719 }, "output": [ "https://replicate.delivery/pbxt/QgeqtIXXJbRhdyxboHfeXw9Gy4KqO3no7W9tDAANaVe82JlHB/output.json", "https://replicate.delivery/pbxt/Y3DvJWrlffgjKEM8lYGjGzNhqB0L2Z8fzF8jcLY40OGh7kyjA/output.png" ], "started_at": "2023-11-17T14:14:55.828498Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/osnb6b3b3bakfmu7jucszlrvwy", "cancel": "https://api.replicate.com/v1/predictions/osnb6b3b3bakfmu7jucszlrvwy/cancel" }, "version": "a671251d28c23a1a476ecfe2e0e4924d49d8141d318eb7fe938b2dcdec952fdd" }
Generated in[11/17 14:15:00 d2.checkpoint.detection_checkpoint]: [DetectionCheckpointer] Loading from checkpoints/CoDet_OVLVIS_SwinB_4x_ft4x.pth ... [11/17 14:15:00 fvcore.common.checkpoint]: [Checkpointer] Loading from checkpoints/CoDet_OVLVIS_SwinB_4x_ft4x.pth ... WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.cls_score.zs_weight' to the model due to incompatible shapes: (512, 5910) in the checkpoint but (512, 4707) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.fc1.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.fc1.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.fc2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.weight_transform.0.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.weight_transform.0.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.0.weight_transform.2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.cls_score.zs_weight' to the model due to incompatible shapes: (512, 5910) in the checkpoint but (512, 4707) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.fc1.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.fc1.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.fc2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.weight_transform.0.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.weight_transform.0.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.1.weight_transform.2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.cls_score.zs_weight' to the model due to incompatible shapes: (512, 5910) in the checkpoint but (512, 4707) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.fc1.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.fc1.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.fc2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.weight_transform.0.weight' to the model due to incompatible shapes: (64, 448) in the checkpoint but (128, 896) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.weight_transform.0.bias' to the model due to incompatible shapes: (64,) in the checkpoint but (128,) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Skip loading parameter 'roi_heads.box_predictor.2.weight_transform.2.weight' to the model due to incompatible shapes: (1, 64) in the checkpoint but (1, 128) in the model! You might want to double check if this is expected. WARNING [11/17 14:15:01 fvcore.common.checkpoint]: Some model parameters or buffers are not found in the checkpoint: roi_heads.box_predictor.0.cls_score.{detection_weight, zs_weight} roi_heads.box_predictor.0.fc1.{bias, weight} roi_heads.box_predictor.0.fc2.weight roi_heads.box_predictor.0.weight_transform.0.{bias, weight} roi_heads.box_predictor.0.weight_transform.2.weight roi_heads.box_predictor.1.cls_score.{detection_weight, zs_weight} roi_heads.box_predictor.1.fc1.{bias, weight} roi_heads.box_predictor.1.fc2.weight roi_heads.box_predictor.1.weight_transform.0.{bias, weight} roi_heads.box_predictor.1.weight_transform.2.weight roi_heads.box_predictor.2.cls_score.{detection_weight, zs_weight} roi_heads.box_predictor.2.fc1.{bias, weight} roi_heads.box_predictor.2.fc2.weight roi_heads.box_predictor.2.weight_transform.0.{bias, weight} roi_heads.box_predictor.2.weight_transform.2.weight
Want to make some of these yourself?
Run this model