import React, { Component } from 'react' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import { Loader, UploadImage } from '../common' import * as actions from './faceSearch.actions' // function parse_bbox(s) { // // "BBox: (77,86), (166, 177), width:89, height:91" // try { // const [x, y, w, h, width, height] = s.replace(/\D/g, ' ').replace(/\s+/g, ' ').trim().split(' ') // return { x, y, w, h } // } // } class FaceSearchQuery extends Component { state = { image: null } upload(blob) { if (this.state.image) { URL.revokeObjectURL(this.state.image) } const url = URL.createObjectURL(blob) this.setState({ image: url }) this.props.actions.upload(this.props.payload, blob) } render() { const { result } = this.props const { image } = this.state console.log(result) const style = {} if (image) { style.backgroundImage = 'url(' + image + ')' style.backgroundSize = 'cover' style.opacity = 1 } return (
{'Use facial recognition to reverse search into the LFW dataset '} {'and see if it contains your photos.'}
Read more about privacy.