Commit fd42e095 by vincent

only keep quantized models in this repo + renamed face_detection_model to ssd_mobilenetv1_model

parent b09fbe45
node_modules node_modules
.rpt2_cache .rpt2_cache
.env* .env*
tmp tmp
\ No newline at end of file weights_uncompressed
\ No newline at end of file
...@@ -3,7 +3,8 @@ const dataFiles = [ ...@@ -3,7 +3,8 @@ const dataFiles = [
'test/images/*.png', 'test/images/*.png',
'test/data/*.json', 'test/data/*.json',
'test/media/*.mp4', 'test/media/*.mp4',
'weights/**/*' 'weights/**/*',
'weights_uncompressed/**/*'
].map(pattern => ({ ].map(pattern => ({
pattern, pattern,
watched: false, watched: false,
......
...@@ -7,7 +7,7 @@ import { loadWeightMap } from '../commons/loadWeightMap'; ...@@ -7,7 +7,7 @@ import { loadWeightMap } from '../commons/loadWeightMap';
import { ConvParams, ParamMapping } from '../commons/types'; import { ConvParams, ParamMapping } from '../commons/types';
import { BoxPredictionParams, MobileNetV1, NetParams, PointwiseConvParams, PredictionLayerParams } from './types'; import { BoxPredictionParams, MobileNetV1, NetParams, PointwiseConvParams, PredictionLayerParams } from './types';
const DEFAULT_MODEL_NAME = 'face_detection_model' const DEFAULT_MODEL_NAME = 'ssd_mobilenetv1_model'
function extractorsFactory(weightMap: any, paramMappings: ParamMapping[]) { function extractorsFactory(weightMap: any, paramMappings: ParamMapping[]) {
......
import * as faceapi from '../../../src'; import * as faceapi from '../../../src';
import { FaceLandmarks5 } from '../../../src/mtcnn/FaceLandmarks5';
import { Point } from '../../../src/Point'; import { Point } from '../../../src/Point';
import { expectMaxDelta, expectPointClose, expectRectClose } from '../../utils'; import { expectMaxDelta, expectPointClose, expectRectClose } from '../../utils';
......
...@@ -79,7 +79,7 @@ describe('faceDetectionNet', () => { ...@@ -79,7 +79,7 @@ describe('faceDetectionNet', () => {
it('disposes all param tensors', async () => { it('disposes all param tensors', async () => {
await expectAllTensorsReleased(async () => { await expectAllTensorsReleased(async () => {
const res = await fetch('base/weights/uncompressed/face_detection_model.weights') const res = await fetch('base/weights_uncompressed/ssd_mobilenetv1_model.weights')
const weights = new Float32Array(await res.arrayBuffer()) const weights = new Float32Array(await res.arrayBuffer())
const net = faceapi.createFaceDetectionNet(weights) const net = faceapi.createFaceDetectionNet(weights)
net.dispose() net.dispose()
......
...@@ -211,7 +211,7 @@ describe('faceLandmarkNet', () => { ...@@ -211,7 +211,7 @@ describe('faceLandmarkNet', () => {
it('disposes all param tensors', async () => { it('disposes all param tensors', async () => {
await expectAllTensorsReleased(async () => { await expectAllTensorsReleased(async () => {
const res = await fetch('base/weights/uncompressed/face_landmark_68_model.weights') const res = await fetch('base/weights_uncompressed/face_landmark_68_model.weights')
const weights = new Float32Array(await res.arrayBuffer()) const weights = new Float32Array(await res.arrayBuffer())
const net = faceapi.createFaceLandmarkNet(weights) const net = faceapi.createFaceLandmarkNet(weights)
net.dispose() net.dispose()
......
...@@ -139,7 +139,7 @@ describe('faceRecognitionNet', () => { ...@@ -139,7 +139,7 @@ describe('faceRecognitionNet', () => {
it('disposes all param tensors', async () => { it('disposes all param tensors', async () => {
await expectAllTensorsReleased(async () => { await expectAllTensorsReleased(async () => {
const res = await fetch('base/weights/uncompressed/face_recognition_model.weights') const res = await fetch('base/weights_uncompressed/face_recognition_model.weights')
const weights = new Float32Array(await res.arrayBuffer()) const weights = new Float32Array(await res.arrayBuffer())
const net = faceapi.createFaceRecognitionNet(weights) const net = faceapi.createFaceRecognitionNet(weights)
net.dispose() net.dispose()
......
...@@ -67,7 +67,7 @@ describe('mtcnn', () => { ...@@ -67,7 +67,7 @@ describe('mtcnn', () => {
it('disposes all param tensors', async () => { it('disposes all param tensors', async () => {
await expectAllTensorsReleased(async () => { await expectAllTensorsReleased(async () => {
const res = await fetch('base/weights/uncompressed/mtcnn_model.weights') const res = await fetch('base/weights_uncompressed/mtcnn_model.weights')
const weights = new Float32Array(await res.arrayBuffer()) const weights = new Float32Array(await res.arrayBuffer())
const net = faceapi.createMtcnn(weights) const net = faceapi.createMtcnn(weights)
net.dispose() net.dispose()
......
...@@ -83,7 +83,7 @@ async function initNet<TNet extends NeuralNetwork<any>>( ...@@ -83,7 +83,7 @@ async function initNet<TNet extends NeuralNetwork<any>>(
) { ) {
await net.load( await net.load(
uncompressedFilename uncompressedFilename
? await loadNetWeights(`base/weights/uncompressed/${uncompressedFilename}`) ? await loadNetWeights(`base/weights_uncompressed/${uncompressedFilename}`)
: 'base/weights' : 'base/weights'
) )
} }
...@@ -115,7 +115,7 @@ export function describeWithNets( ...@@ -115,7 +115,7 @@ export function describeWithNets(
if (withFaceDetectionNet || withAllFaces) { if (withFaceDetectionNet || withAllFaces) {
await initNet<faceapi.FaceDetectionNet>( await initNet<faceapi.FaceDetectionNet>(
faceDetectionNet, faceDetectionNet,
!!withFaceDetectionNet && !withFaceDetectionNet.quantized && 'face_detection_model.weights' !!withFaceDetectionNet && !withFaceDetectionNet.quantized && 'ssd_mobilenetv1_model.weights'
) )
} }
if (withFaceLandmarkNet || withAllFaces) { if (withFaceLandmarkNet || withAllFaces) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment