How to use the @tensorflow-models/coco-ssd.load function in @tensorflow-models/coco-ssd

To help you get started, we’ve selected a few @tensorflow-models/coco-ssd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SkalskiP / make-sense / src / ai / ObjectDetector.ts View on Github external
public static loadModel(callback?: () => any) {
        cocoSsd
            .load()
            .then((model: ObjectDetection) => {
                ObjectDetector.model = model;
                store.dispatch(updateObjectDetectorStatus(true));
                const activeLabelType: LabelType = LabelsSelector.getActiveLabelType();
                activeLabelType === LabelType.RECTANGLE && AIObjectDetectionActions.detectRectsForActiveImage();
                callback && callback();
            })
            .catch((error) => {
                // TODO
                throw new Error(error);
            })
    }
github leartgjoni / webcam-object-detection / src / App.js View on Github external
async componentDidMount() {
    try {
      const stream = await navigator.mediaDevices.getUserMedia({
        video: {
          facingMode: "user"
        },
        audio: false
      });

      const model = await cocoSsd.load();

      await this.setState({
        videoElement: this.refs.video,
        canvasElement: this.refs.canvas,
        stream,
        model
      });

      this.state.videoElement.srcObject = this.state.stream;
      this.predictFrame();
    } catch (err) {
      console.log(err);
    }
  }
github avatsaev / angular-tensorflowjs-example / src / app / app.component.ts View on Github external
async ngOnInit() {
    this.model = await cocoSsd.load({base: 'lite_mobilenet_v2'});
    await this.detectFrame();
    await this.videoRef.nativeElement.play();
  }
github HunterXuan / wx-tfjs-demo / models / coco-ssd / classifier.js View on Github external
return new Promise((resolve, reject) => {
      cocoSsd.load({
        modelUrl: SSD_NET_URL
      }).then(model => {
        this.ssdNet = model
        this.ready = true
        resolve()
      }).catch(err => {
        reject(err)
      })
    })
  }
github overflowjs-com / image_object_detection_tensor_api / src / api / object_detectors / ObjectDetectors.js View on Github external
async loadCocoSsdModal() {
        const modal = await cocossd.load({
            base: 'mobilenet_v2'
        })
        return modal;
    }
github tensorflow / tfjs-models / coco-ssd / demo / index.js View on Github external
window.onload = () => modelPromise = cocoSsd.load();
github ml5js / ml5-library / src / ObjectDetector / CocoSsd / index.js View on Github external
async loadModel() {

        this.model = await cocoSsd.load(this.config);

        this.modelReady = true;
        return this;
    }
github tensorflow / tfjs-models / coco-ssd / demo / index.js View on Github external
select.onchange = async (event) => {
  const model = await modelPromise;
  model.dispose();
  modelPromise = cocoSsd.load(
      {base: event.srcElement.options[event.srcElement.selectedIndex].value});
};

@tensorflow-models/coco-ssd

Object detection model (coco-ssd) in TensorFlow.js

Apache-2.0
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis

Popular @tensorflow-models/coco-ssd functions

Similar packages