amaljoseph / Signature-Verification_System_using_YOLOv5-and-CycleGAN

An end-to-end signature verification system to extract, clean and verify signatures in documents. Signatures are detected using YOLOv5. Noise is cleaned using a CycleGAN approach and verified. Keras / Tensorflow / PyTorch
151 stars 56 forks source link

Update links for Model file for VGG16 Feature Extractor #15

Open practiceJim opened 10 months ago

practiceJim commented 10 months ago

Hey there! 👋

I was checking out your awesome project's README and noticed that there's a mention about the availability of the model file for the VGG16 feature extractor. The readme mentions that the file will be available soon, but as of now, it seems there's no file provided.

Could you please update the links or provide the model file for the VGG16 feature extractor whenever it's convenient for you? It would be super helpful for users like me who are excited to dive into your project and utilize the VGG16 model.

Looking forward to using your fantastic work! 🚀

Thanks a bunch! 😊

Cheers, Jim

practiceJim commented 10 months ago

If saved_model.pb is the vgg16 model then this error I am getting seems to be something else. Any help would be great! Error:

FileNotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for SOURCE/vgg_finetuned_model/variables/variables You may be trying to load on a different device from the computational device. Consider setting the 'experimental_io_device' option in 'tf.saved_model.LoadOptions' to the io_device such as '/job:localhost'.
Traceback:

File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)
File "/content/Signature-Verification_System_using_YOLOv5-and-CycleGAN/Streamlit_App/ui.py", line 152, in <module>
    main()
File "/content/Signature-Verification_System_using_YOLOv5-and-CycleGAN/Streamlit_App/ui.py", line 150, in main
    signature_verify(session_state.selection)
File "/content/Signature-Verification_System_using_YOLOv5-and-CycleGAN/Streamlit_App/ui.py", line 67, in signature_verify
    feature_set = vgg_verify.verify(anchor_image, GAN_OP_RESIZED)
File "/content/Signature-Verification_System_using_YOLOv5-and-CycleGAN/Streamlit_App/SOURCE/vgg_finetuned_model/vgg_verify.py", line 39, in verify
    vgg_model = tf.keras.models.load_model('SOURCE/vgg_finetuned_model', options = options)
File "/usr/local/lib/python3.10/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/saved_model/load.py", line 977, in load_internal
    raise FileNotFoundError(
practiceJim commented 10 months ago

Managed to train the model using the given notebook, but at the verification stage still ran into this error:

creating web directory ./results/gan/gan_signdata_kaggle/test_latest
processing (0000)-th image... ['results/gan/gan_signdata_kaggle/gan_ips/testB/1.jpg']
2023-12-18 15:54:20.953114: W tensorflow/core/framework/cpu_allocator_impl.cc:82] Allocation of 411041792 exceeds 10% of free system memory.
2023-12-18 15:54:22.318 Uncaught app exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)
  File "/content/drive/MyDrive/abc/Streamlit_App/ui.py", line 152, in <module>
    main()
  File "/content/drive/MyDrive/abc/Streamlit_App/ui.py", line 150, in main
    signature_verify(session_state.selection)
  File "/content/drive/MyDrive/abc/Streamlit_App/ui.py", line 67, in signature_verify
    feature_set = vgg_verify.verify(anchor_image, GAN_OP_RESIZED)
  File "/content/drive/MyDrive/abc/Streamlit_App/SOURCE/vgg_finetuned_model/vgg_verify.py", line 44, in verify
    vgg_model = tf.keras.models.load_model('SOURCE/vgg_finetuned_model')
  File "/usr/local/lib/python3.10/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/usr/local/lib/python3.10/dist-packages/keras/saving/saved_model/load.py", line 466, in _revive_from_config
    obj, self._proto.nodes[node_id], node_id)
IndexError: list index (379) out of range

Searched a lot couldn't make sense of it. Was running the project on colab using ngrok

nooruzb commented 4 months ago

I also encountered while using the model file provided for vgg16 in the google drive, the hyper link "Models here" in Readme file takes to that path... The error I got was, it was looking for Variables in the location at SOURCE/vgg_finetuned_model....Do I need to have variables directory from somewhere?