-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels.js
More file actions
31 lines (24 loc) · 879 Bytes
/
Copy pathmodels.js
File metadata and controls
31 lines (24 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const tf = require('@tensorflow/tfjs-node')
async function Model(model_url = null){
// """ Proposal Network, receives an image and outputs
// bbox offset regressions and confidence scores for each sliding
// window of 12x12
// """
// """ Refine Network, receives image crops from PNet and outputs
// further offset refinements and confidence scores to filter out
// the predictions
// """
// """ Output Network, receives image crops from RNet and outputs
// final offset regressions, facial landmark positions and confidence scores
// """
if (model_url != null){
try {
const model = await tf.loadLayersModel(model_url);
return model
} catch (error) {
console.error('You need to connect to internet')
}
}
return "missing model url"
}
module.exports = Model