naver / garnet

Apache License 2.0
58 stars 7 forks source link

Pre-trained Ensnet #6

Open UsamaRehman001 opened 1 year ago

UsamaRehman001 commented 1 year ago

How can i use your pretrained Ensnet and inference it on my own real world dataset? @naveross

hsl323 commented 1 year ago

For Ensnet, you need to write inference code, you can refer to https://github.com/naver/garnet/blob/master/CODE/inference.py for this.

EnsNet does not use text box. Therefore, you only need to use the image as an input.

in def test(args, net):

First, comment out everything related to box.

Second, modify the model inference part to fit EnsNet.

https://github.com/naver/garnet/blob/c5a7adb684979ecaa25603dd1aa71a8283d5dadb/CODE/inference.py#L104-L107 to

# inference 
 with torch.no_grad(): 
     _, _, _, _, result = net(x) 

https://github.com/naver/garnet/blob/c5a7adb684979ecaa25603dd1aa71a8283d5dadb/CODE/inference.py#L167

Third, Change model to EnsNet.