Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Grayscale prediction #60

Open
pmikas opened this issue Feb 10, 2021 · 4 comments
Open

Grayscale prediction #60

pmikas opened this issue Feb 10, 2021 · 4 comments

Comments

@pmikas
Copy link

pmikas commented Feb 10, 2021

Hello!

I trained a model in grayscale, so I am also trying to predict in grayscale. Is there a way to set the prediction with 1 channel?

Regards

@hhk7734
Copy link
Owner

hhk7734 commented Feb 10, 2021

def make_model(
self,
activation0: str = "mish",
activation1: str = "leaky",
kernel_regularizer=tf.keras.regularizers.l2(0.0005),
):
# pylint: disable=missing-function-docstring
self._has_weights = False
backend.clear_session()
# height, width, channels
inputs = layers.Input([self.input_size[1], self.input_size[0], 3])
if self.tiny:
self.model = yolov4.YOLOv4Tiny(
anchors=self.anchors,
num_classes=len(self.classes),
xyscales=self.xyscales,
activation=activation1,
kernel_regularizer=kernel_regularizer,
)
else:
self.model = yolov4.YOLOv4(
anchors=self.anchors,
num_classes=len(self.classes),
xyscales=self.xyscales,
activation0=activation0,
activation1=activation1,
kernel_regularizer=kernel_regularizer,
)
self.model(inputs)

Line 66 - inputs = layers.Input([self.input_size[1], self.input_size[0], 3])
try to change 3 to 1.

@pmikas
Copy link
Author

pmikas commented Feb 11, 2021

Thanks for the reply

It doesn't work. Even adjusting other parts of the code, the output isn't the same as from darknet

@hhk7734
Copy link
Owner

hhk7734 commented Feb 11, 2021

I'm working on yolov4 v3.0.
I will try after release.

@hhk7734
Copy link
Owner

hhk7734 commented Feb 13, 2021

Can you share 1 channel dataset?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants