summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/faceSearch/faceSearch.query.js10
-rw-r--r--megapixels/app/models/sql_factory.py4
2 files changed, 12 insertions, 2 deletions
diff --git a/client/faceSearch/faceSearch.query.js b/client/faceSearch/faceSearch.query.js
index 425cb282..20d200bb 100644
--- a/client/faceSearch/faceSearch.query.js
+++ b/client/faceSearch/faceSearch.query.js
@@ -5,6 +5,14 @@ import { connect } from 'react-redux'
import { Loader } 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
@@ -32,6 +40,7 @@ class FaceSearchQuery extends Component {
render() {
const { result } = this.props
const { image } = this.state
+ console.log(result)
const style = {}
if (image) {
style.backgroundImage = 'url(' + image + ')'
@@ -47,6 +56,7 @@ class FaceSearchQuery extends Component {
</div>
: <div style={style}>
{image ? null : <img src="/assets/img/icon_camera.svg" />}
+
<input
type="file"
name="img"
diff --git a/megapixels/app/models/sql_factory.py b/megapixels/app/models/sql_factory.py
index da95b539..b270afd2 100644
--- a/megapixels/app/models/sql_factory.py
+++ b/megapixels/app/models/sql_factory.py
@@ -35,7 +35,7 @@ def load_sql_datasets(replace=False, base_model=None):
global datasets, loaded, Session
if loaded:
return datasets
- engine = create_engine(connection_url, encoding="utf-8")
+ engine = create_engine(connection_url, encoding="utf-8", pool_recycle=3600)
# db.set_character_set('utf8')
# dbc = db.cursor()
# dbc.execute('SET NAMES utf8;')
@@ -76,7 +76,7 @@ class SqlDataset:
self.name = name
self.tables = {}
if base_model is None:
- self.engine = create_engine(connection_url)
+ self.engine = create_engine(connection_url, encoding="utf-8", pool_recycle=3600)
base_model = declarative_base(engine)
self.base_model = base_model