Hello James! Thanks a lot for your explanation the only thing is- I can't be the only one who struggles with resolution when 720p is the maximum. Is there any chance you might upload these in full HD in the future? Don't mean to sound ungrateful or anything- it's great, just had to squint hard. : ) Cheers!
Hello James,, thanks for the amazing video and explanation,, I have a few questions,, if I am using it on my own sample video,, where to get input fake images ?? and also how to change the code to be able to train it on more than one video (will consider videos as classes so I want to train it on several classes )? and when predicting how to get a video of a certain class given that class label in addition to the noise? (or how to change it to conditional GAN)
Hi James, Thanks for the wonderful video. I am trying to implement your github code. I am trying to get Models/Saved_GAN/ folder up by turning the option train_gan to True at Line no 522. Hope this is right? also, when I do this I am getting open Cv error even when cv import is included. Exact error " File "GAN.py", line 130, in create_numpy_dataset_from_video img = cv2.resize(img, (new_width, new_height)) cv2.error: OpenCV(4.1.2) /io/opencv/modules/imgproc/src/resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'resize'". I am working in Colab, how am I to fix this? Thanks in advance!
I don’t believe so however can’t remember. But also remember each example is a set of n frames that must be sequential since this is video. Shuffling the examples I don’t think would matter much.
@@JamesOliver thanks for reply, for generator to be able to recomstruct a video in that order is mindblowing, what if instead you input noise to generate the video, you input another video?
Hi James, great video, very understandable walkthrough. I'm trying to run the code on my own system. I pieced together the requirements.txt file to get all the pre-reqs loaded. I'm getting an error where it looks as if its expecting "generator.hdf5" to exist in a path defined as Models/Saved_GAN/ That file is not in repo, should it be? What am I missing here? Thanks for your help.
@@JamesOliver Hey James, I finally figured it out. I appreciate your dedication and willingness to help a total stranger though, really thoughtful. I will post my requirements.txt and build info after I'm 1000% sure it's the best way to go about running this on linux. Thanks Again
@@JamesOliver How do you add a 4th dimension? Do you change these into 4D? model.add(UpSampling3D()) # Transforms small input to a large image output model.add(Conv3D(128, kernel_size=(3, 3, 3), activation='relu', name='Conv3D_1')) Also how would one approach this code to make it train on multiple videos?
Getting this error 2022-11-06 08:31:26.445687: I tensorflow/stream_executor/cuda/cuda_blas.cc:1614] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.
I'm getting an error where it looks as if its expecting "generator.hdf5" to exist in a path defined as Models/Saved_GAN/. May I please have some help?@@JamesOliver
Hello James, your way of explanation is simply superb.
Please keep up the good work.
Prasanta S Thanks so much. Really appreciate the positive feedback. ML videos can be tough to explain sometimes.
Hello James! Thanks a lot for your explanation the only thing is- I can't be the only one who struggles with resolution when 720p is the maximum. Is there any chance you might upload these in full HD in the future? Don't mean to sound ungrateful or anything- it's great, just had to squint hard. : )
Cheers!
Hello James! Thanks a lot for your explanation. How to save the video after adding noise? I wan to compare input and output that video.
Hello James,, thanks for the amazing video and explanation,, I have a few questions,, if I am using it on my own sample video,, where to get input fake images ??
and also how to change the code to be able to train it on more than one video (will consider videos as classes so I want to train it on several classes )? and when predicting how to get a video of a certain class given that class label in addition to the noise? (or how to change it to conditional GAN)
Hi James, Thanks for the wonderful video. I am trying to implement your github code. I am trying to get Models/Saved_GAN/ folder up by turning the option train_gan to True at Line no 522. Hope this is right? also, when I do this I am getting open Cv error even when cv import is included. Exact error " File "GAN.py", line 130, in create_numpy_dataset_from_video
img = cv2.resize(img, (new_width, new_height))
cv2.error: OpenCV(4.1.2) /io/opencv/modules/imgproc/src/resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'resize'". I am working in Colab, how am I to fix this? Thanks in advance!
incredible
permission to learn sir. thanks
Amazing work! Is there source code available?
I have to clean the code up before putting on github.
@@JamesOliver if you do clean it up and make it public, please shoot me a notification.
ChessFlix will do!
@@JamesOliver Amazing work, bud! I'll be waiting for your notification.
@@akshitgandhi8666 Code is here: github.com/JamieMicro/How_To/tree/master/02_GAN_Video
one question did you shuffle the frames before feeding to discriminator or you fed the video in order?
I don’t believe so however can’t remember. But also remember each example is a set of n frames that must be sequential since this is video. Shuffling the examples I don’t think would matter much.
@@JamesOliver thanks for reply, for generator to be able to recomstruct a video in that order is mindblowing, what if instead you input noise to generate the video, you input another video?
Your model can be used for video next frame prediction?
I guess it could, sure.
Hi James, great video, very understandable walkthrough. I'm trying to run the code on my own system. I pieced together the requirements.txt file to get all the pre-reqs loaded. I'm getting an error where it looks as if its expecting "generator.hdf5" to exist in a path defined as Models/Saved_GAN/ That file is not in repo, should it be? What am I missing here? Thanks for your help.
That is the model file that you can create with the code. It was too large to upload if I remember correctly.
@@JamesOliver I dont mean to get into the weeds here but if you could dump your requirements.txt file, I think it will help alot. This is what I'm getting with the default latest versions of everything: 2020-10-31 12:27:22.987700: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-10-31 12:27:22.988905: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-10-31 12:27:22.988915: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d (Conv2D) (None, 24, 43, 128) 96128
_________________________________________________________________
leaky_re_lu (LeakyReLU) (None, 24, 43, 128) 0
_________________________________________________________________
dropout (Dropout) (None, 24, 43, 128) 0
_________________________________________________________________
conv2d_1 (Conv2D) (None, 12, 22, 256) 295168
_________________________________________________________________
leaky_re_lu_1 (LeakyReLU) (None, 12, 22, 256) 0
_________________________________________________________________
dropout_1 (Dropout) (None, 12, 22, 256) 0
_________________________________________________________________
flatten (Flatten) (None, 67584) 0
_________________________________________________________________
dense (Dense) (None, 1) 67585
=================================================================
Total params: 458,881
Trainable params: 458,881
Non-trainable params: 0
_________________________________________________________________
Model: "sequential_1"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
Dense_1 (Dense) (None, 100) 10100
_________________________________________________________________
Reshape_1 (Reshape) (None, 5, 4, 5, 1) 0
_________________________________________________________________
up_sampling3d (UpSampling3D) (None, 10, 8, 10, 1) 0
_________________________________________________________________
Conv3D_1 (Conv3D) (None, 8, 6, 8, 128) 3584
_________________________________________________________________
batch_normalization (BatchNo (None, 8, 6, 8, 128) 512
_________________________________________________________________
up_sampling3d_1 (UpSampling3 (None, 16, 12, 16, 128) 0
_________________________________________________________________
Conv3D_2 (Conv3D) (None, 15, 11, 15, 64) 65600
_________________________________________________________________
batch_normalization_1 (Batch (None, 15, 11, 15, 64) 256
_________________________________________________________________
flatten_1 (Flatten) (None, 158400) 0
_________________________________________________________________
Dense_2 (Dense) (None, 256) 40550656
_________________________________________________________________
Dense_Output (Dense) (None, 122400) 31456800
_________________________________________________________________
reshape (Reshape) (None, 48, 85, 30) 0
=================================================================
Total params: 72,087,508
Trainable params: 72,087,124
Non-trainable params: 384
_________________________________________________________________
======================================================================================
Loading saved generator model...
Traceback (most recent call last):
File "GAN.py", line 547, in
generator = load_model(os.path.join(MODEL_SAVE_FOLDER, 'generator.hdf5'))
File "/root/git/How_To/env/lib/python3.8/site-packages/tensorflow/python/keras/saving/save.py", line 186, in load_model
loader_impl.parse_saved_model(filepath)
File "/root/git/How_To/env/lib/python3.8/site-packages/tensorflow/python/saved_model/loader_impl.py", line 110, in parse_saved_model
raise IOError("SavedModel file does not exist at: %s/{%s|%s}" %
OSError: SavedModel file does not exist at: Models/Saved_GAN/generator.hdf5/{saved_model.pbtxt|saved_model.pb}
@@joeljohnston9339 I have many virtual environments but will try and get it for you tomorrow
@@JamesOliver Hey James, I finally figured it out. I appreciate your dedication and willingness to help a total stranger though, really thoughtful. I will post my requirements.txt and build info after I'm 1000% sure it's the best way to go about running this on linux. Thanks Again
@@joeljohnston9339 Awesome! That would be great if you could post that info.
But what if you want to use RGB-Channels (color)?
Against NAZO! You would add a 4th dimension is all.
@@JamesOliver How do you add a 4th dimension?
Do you change these into 4D?
model.add(UpSampling3D()) # Transforms small input to a large image output
model.add(Conv3D(128, kernel_size=(3, 3, 3), activation='relu', name='Conv3D_1'))
Also how would one approach this code to make it train on multiple videos?
Getting this error
2022-11-06 08:31:26.445687: I tensorflow/stream_executor/cuda/cuda_blas.cc:1614] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.
Can i copy and paste the code into python??
Should be able to yes
I'm getting an error where it looks as if its expecting "generator.hdf5" to exist in a path defined as Models/Saved_GAN/. May I please have some help?@@JamesOliver