Comments (16)
Hi, can you try load model, rather than using load weights
For example.
from tensorflow import keras
g_model_coarse= keras.models.load_model('coarse_model.h5')
g_model_fine = keras.models.load_model('fine_model.h5')
from rvgan.
It didn't work. Error msg is
ValueError: Unknown layer: ReflectionPadding2D
from rvgan.
Please write this code before loading the model.
import tensorflow as tf
from keras.layers import Layer, InputSpec,
class ReflectionPadding2D(Layer):
def __init__(self, padding=(1, 1), **kwargs):
if type(padding) == int:
padding = (padding, padding)
self.padding = padding
self.input_spec = [InputSpec(ndim=4)]
super(ReflectionPadding2D, self).__init__(**kwargs)
def compute_output_shape(self, s):
""" If you are using "channels_last" configuration"""
return (s[0], s[1] + 2 * self.padding[0], s[2] + 2 * self.padding[1], s[3])
def call(self, x, mask=None):
w_pad,h_pad = self.padding
return tf.pad(x, [[0,0], [h_pad,h_pad], [w_pad,w_pad], [0,0] ], 'REFLECT')
from rvgan.
It didn't work. Same error.
from rvgan.
Hi,
I re-uploaded the weights for Chase. Its the same download link.
Can you try again with your original code?
Thanks
Download link
https://drive.google.com/drive/folders/1e_dMNjwsPo9ykoYuy3Fn0cmTg1FH8K5H?usp=sharing
from rvgan.
Yes,it worked. Thanks!
Did you update the weights for DRIVE and STARE?
from rvgan.
Hi,
For the STARE and DRIVE, can you try stride=3 for generating the crops.
from rvgan.
This is the predicting image1 I use pretrained model Drive to generate with stride of 64. I used other model to generate images with stride of 3, but the f1 just improve less than 1%.
from rvgan.
Hi
I just tested the DRIVE models and its giving me good outputs.
Check the outputs in the following shared drive
https://drive.google.com/drive/folders/1bEqtQj8P6iNXQASJdIY42W05MVjYdR48?usp=sharing
Also I have written a Google Colab Notebook which was used to generate the outputs.
Try to replicate the code by yourself from the notebook
https://colab.research.google.com/drive/1Emoz0rdRgYauDq7u0DBrmb2VFdrxyqpI?usp=sharing
Hope this helps !
Thanks
from rvgan.
Hello,
I find where the problem is. In the SFA block, I connect the first added tensor to the output instead of connecting the input to the output. But the weight can be loaded in. It seems that this connection is important and it's interesting.
Using the pretrained model, I finally get the correct result. But stride 3 still doesn't improve a lot.
Another question
How do you calculate the mean IOU and SSIM? It's so high.
TP/(TP+FP+FN) ? I calculate mIOU using this which is lower.
It's very nice of you.
Thank you for help.
from rvgan.
Hi,
I have uploaded the eval,.py code (link : https://github.com/SharifAmit/RVGAN/blob/master/eval.py)
I am closing the issue for now. If I find any problem with the results please open this issue again.
Thanks
from rvgan.
Hi,
I have uploaded the eval,.py code (link : https://github.com/SharifAmit/RVGAN/blob/master/eval.py)
I am closing the issue for now. If I find any problem with the results please open this issue again.
Thanks
Thanks for your wonderful work! However, I am still confused about the mIoU calculation.
In my opinion, we always calculate IoU for each class (2 classes in the vessel segmentation task, background and vessel), then report the average value as mIoU. But the eval,.py code (https://github.com/SharifAmit/RVGAN/blob/master/eval.py) utilizes the jaccard_similarity_score function to sum correct predictions for all categories and calculate the "total" IoU. It's a little strange...
from rvgan.
@martin-liao In eval.py we used the normalize=True flag in the jaccard_similarity_score function, which calculates the average Jaccard similarity coefficient not the sum of the correct prediction.
https://scikit-learn.org/0.15/modules/generated/sklearn.metrics.jaccard_similarity_score.html
From the documentation,
normalize : bool, optional (default=True)
If False, return the sum of the Jaccard similarity coefficient over the sample set. Otherwise, return the average of Jaccard similarity coefficient.
from rvgan.
Thanks for your response!
Yeah, I disregarded the normalize option. You are right.
from rvgan.
Another question: all the mIoU indexes reported in the manuscript are really high (e.g., U-Net, miou=0.9536 on CHASE-DB1). However, when I train the model with the mmseg toolbox following your settings, the mIoU is significantly lower. I was wondering if any trick (like NMS?) used during evaluation ?
from rvgan.
Furthermore, the DconnNet (accepted by CVPR2023) reported that the U-Net achieved iou=59.3 of vessel class on the CHASE-DB1 dataset. I know that the train and evaluation settings, software and hardware environments are different, but the performance gap of U-Net reported between RV-GAN and U-Net is too large.
from rvgan.
Related Issues (20)
- Inference time HOT 1
- Code for printing the metrics HOT 5
- Some questions about the paper and code HOT 9
- Killed error HOT 1
- local_plot predictions always blank HOT 3
- How to determine the best model HOT 4
- need help! HOT 2
- Hello! HOT 5
- Hi~ HOT 1
- Having nan value for all the losses HOT 1
- length error! HOT 3
- libtiff error
- Pretrained Weights
- When we run train.py, I find the loss is 'nan' at epchs 2. Do you have this problem. I want to know why and how to solve it. HOT 1
- Question HOT 12
- whether we need to pay attention to some details during training? HOT 12
- Question about loss decline HOT 2
- How should we train the model using tf 2.6.0? HOT 4
- Warning while training HOT 2
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 rvgan.