資源簡介
實現數據提取的核心代碼以及videocaption任務的主要方式
代碼片段和文件信息
#-*-?coding:?utf-8?-*-
‘‘‘
functions?to?extract?VGG?(or?any?other)?features?from?videos:
For?each?video:
1.?extract?frames?from?video?(using?Opencv)
2.?select?n?(n=80?in?this?case)?frames
3.?rezie?and?crop?the?selected?frames
4.??For?each?frames:
????1.?feed?to?the?VGG-16?model?(providied?with?pre-trained?weight?using?Caffe)
????2.?obtain?the?VGG?features:?1*4096
5.?obtain?the?VGG?features?of?all?n?frames?and?store?the?result?as?an?array?(shape:?n*4096)
‘‘‘
import?sys
import?cv2
import?os
import?numpy?as?np
import?skimage
import?tensorflow?as?tf
import?os
import?numpy?as?np
import?torch
import?torch.nn
import?torchvision.models?as?models
from?torch.autograd?import?Variable?
import?torch.cuda
import?torchvision.transforms?as?transforms
from?PIL?import?Image
#os.environ[“CUDA_DEVICE_ORDER“
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5726??2019-02-22?16:01??extract_RGB_feats.py
?????文件???????5024??2019-02-22?18:52??feats_exact實際應用.py
?????文件??????33677??2019-02-26?10:25??model_RGB.py
?????文件??????34076??2019-02-28?10:13??model_RGB實際應用.py
?????文件????????893??2019-02-22?09:53??resnet101_feat_exact.py
-----------?---------??----------?-----??----
????????????????79396????????????????????5
- 上一篇:PCB 郵票孔半孔工藝
- 下一篇:三軸加速度傳感器實驗 stm32
評論
共有 條評論