Skip to content

Commit ff364db

Browse files
committed
update retinafaceAntiCov
1 parent 2b1f65d commit ff364db

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

retinafaceAntiCov/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ sudo ./retinafaceAntiCov -s // build and serialize model to file i.e. 'retinafa
2727
wget http://www.kaixian.tv/gd/d/file/201611/07/23efff3a26e2385620e719378c654fb1.jpg -O test.jpg
2828
sudo ./retinafaceAntiCov -d // deserialize model file and run inference.
2929
30-
3. check the images generated, as follows. out.jpg
30+
3. check the image generated, as follows 'out.jpg'
3131
```
3232

3333
<p align="center">

retinafaceAntiCov/gen_wts.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import struct
2+
from retinaface_cov import RetinaFaceCoV
3+
4+
gpuid = 0
5+
model = RetinaFaceCoV('./cov2/mnet_cov2', 0, gpuid, 'net3l')
6+
7+
f = open('retinafaceAntiCov.wts', 'w')
8+
f.write('{}\n'.format(len(model.model.get_params()[0].keys()) + len(model.model.get_params()[1].keys())))
9+
for k, v in model.model.get_params()[0].items():
10+
vr = v.reshape(-1).asnumpy()
11+
f.write('{} {} '.format(k, len(vr)))
12+
for vv in vr:
13+
f.write(' ')
14+
f.write(struct.pack('>f',float(vv)).hex())
15+
f.write('\n')
16+
for k, v in model.model.get_params()[1].items():
17+
vr = v.reshape(-1).asnumpy()
18+
f.write('{} {} '.format(k, len(vr)))
19+
for vv in vr:
20+
f.write(' ')
21+
f.write(struct.pack('>f',float(vv)).hex())
22+
f.write('\n')
23+

retinafaceAntiCov/retinafaceAntiCov.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
using namespace nvinfer1;
3030

3131
// stuff we know about the network and the input/output blobs
32-
static const int INPUT_H = 640;
33-
static const int INPUT_W = 640;
32+
static const int INPUT_H = decodeplugin::INPUT_H;
33+
static const int INPUT_W = decodeplugin::INPUT_W;
3434
static const int DETECTION_SIZE = sizeof(decodeplugin::Detection) / sizeof(float);
3535
static const int OUTPUT_SIZE = (INPUT_H / 8 * INPUT_W / 8 + INPUT_H / 16 * INPUT_W / 16 + INPUT_H / 32 * INPUT_W / 32) * 2 * DETECTION_SIZE + 1;
3636
const char* INPUT_BLOB_NAME = "data";

0 commit comments

Comments
 (0)