Ask Your Question

Revision history [back]

OK. What I did was to look at the online face demo and pull code from that. the port it to Vue and axios. This is just a hard coded version but using the same concept it can be made generalized.

  createFileFromURL(file, url, cb) {
    axios.get('/models/haarcascades/haarcascade_frontalface_default.xml')
    .then((resp) => {
      let rtn = this.$cv.FS_createDataFile('/', file, resp.data, true, false, false)
      cb()
    })
    .catch((err) => {
      // eslint-disable-next-line
      console.log('ERR',err);
    })
  },