Comments (5)
You can do streaming inference either submitting the whole clip to the network, or submitting subclips without cleaning the buffer (similarly to how it is done in training).
The simplest way is the first one and you perform inference almost like the non streaming network, you just have to remember to clear the stream buffer every new clip like in the code snippet below.
There is not much documentation because currently the streaming models are not available pretrained.
def evaluate(model, data_load, loss_val):
model.eval()
samples = len(data_load.dataset)
csamp = 0
tloss = 0
with torch.no_grad():
for data, _, target in data_load:
model.clean_activation_buffers()
output = F.log_softmax(model(data), dim=1)
loss = F.nll_loss(output, target, reduction='sum')
_, pred = torch.max(output, dim=1)
tloss += loss.item()
csamp += pred.eq(target).sum()
aloss = tloss / samples
loss_val.append(aloss)
from movinet-pytorch.
thanks .
if models is trained on let us assume on (50,224,224,3) input size then how are they doing inference ? because on official implementation ,we can pass any input size .
but how it is possible ,once model is trained on 50 frame inputs.
can you explain.
https://github.com/tensorflow/models/tree/master/official/vision/beta/projects/movinet
from movinet-pytorch.
If you have question about the official implementation you should ask them, I'm not aware of every details of their implementation.
Anyway, In a general sense you can always change the input shape, generally neural networks are resilient to changes in input shapes. You probably won't get the same accuracy though.
To further explain, in the notebook linked below I finetune with a different number of frames (16), on another dataset and it is perfectly fine.
https://github.com/Atze00/MoViNet-pytorch/blob/main/movinet_tutorial.ipynb
from movinet-pytorch.
can you explain how to do inference on single video? you didnt mentioned it into your notebook.
also where are you saving model checkpoint and how do you loading it during inference .
from movinet-pytorch.
These questions are related to the Pytorch framework more than this particular implementation, you can ask to a pytorch forum if you have problems doing inference of one single sample. The model is kept in ram, it is not saved on the disk and reloaded at least in the tutorial. You can easily find pytorch tutorials on how to save and load models.
from movinet-pytorch.
Related Issues (20)
- Using MoViNet in a dataset with variable-length videos HOT 1
- why don't you use 'T.Normalize' when you train HMDB51? HOT 1
- Neural network arch displayed by Netron is wrong HOT 7
- Tips for Implementing a3 ,a4,a5 movinets streaming version HOT 3
- Test model based on 'evaluate_stream' is ok, but do inference frame by frame is very different? HOT 2
- Validation Loss did not decrease in the HMDB51 notebook? HOT 9
- Modifying for binary classification HOT 2
- Kinetics 400 models HOT 1
- Very low validation accuracy with pretrained models! HOT 1
- F.ToFloatTensorInZeroOne not exist HOT 2
- 。
- There seems no implementation of positional_encoding HOT 4
- How can we access the stream buffer? HOT 1
- need to process HMDB51 dataset?
- got wrong results during test
- weight
- The parameters that trained on Charades.
- Kinetics400/600
- Training
- Training on the custom dataset HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from movinet-pytorch.