-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to save trained models? #6
Comments
I'm not sure that these models are usable with OpenCV? They are Torch7 models meant for use with fast-neural-style: https://github.com/jcjohnson/fast-neural-style |
It is easy to use your torch7 models in opencv here is the code if you want. construct the argument parser and parse the argumentsclass Args: args=Args() grab the paths to all neural style transfer models in our 'models'directory, provided all models end with the '.t7' file extensionmodelPaths = paths.list_files(args.models, validExts=(".t7",)) generate unique IDs for each of the model paths, then combine thetwo lists togethermodels = list(zip(range(0, len(modelPaths)), (modelPaths))) use the cycle function of itertools that can loop over all modelpaths, and then when the end is reached, restart againmodelIter = itertools.cycle(models) load the neural style transfer model from diskprint("[INFO] loading style transfer model...") initialize the video stream, then allow the camera sensor to warm upprint("[INFO] starting video stream...") loop over frames from the video file streamwhile True:
do a bit of cleanupcv2.destroyAllWindows() |
thanks for the reply, but the like you provided is working with lua and i am using python 3.6 on Jupiter notebook. |
This may sound like a stupid question but i cannot find the way to save my trained model as .t7 file to use through openCV can u tell me how you did it from the start please or direct me from where i can learn it.
The text was updated successfully, but these errors were encountered: