资源简介
实现数据提取的核心代码以及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
评论
共有 条评论