小编Bor*_*koP的帖子

如何只留下图像中最大的斑点?

我有一个大脑的二进制图像。我只想将斑点留在中心,并消除这种圆形外观中的周围“噪音”。

这是一个示例图像:

脑先生

我尝试使用 OpenCV 并获取计数,但失败了。我也根本不需要边界矩形框,我只想保留图像中的中心斑点,就像我提供的图像中那样,并去除周围的噪声/圆圈。这可能吗?

python opencv image-segmentation

6
推荐指数
1
解决办法
1781
查看次数

使用 keras 和 tf 不使用 fit() 的 Tensorboard

我之前使用过带有一些相当简单的神经网络的张量板,每次我只是在 model.fit() 函数上使用回调。我尝试更多地了解 GAN,并尝试理解一些像这样的代码

class ACGAN():
    def __init__(self):
        # Input shape
        self.img_rows = 28
        self.img_cols = 28
        self.channels = 1
        self.img_shape = (self.img_rows, self.img_cols, self.channels)
        self.num_classes = 10
        self.latent_dim = 100

        optimizer = Adam(0.0002, 0.5)
        losses = ['binary_crossentropy', 'sparse_categorical_crossentropy']

        # Build and compile the discriminator
        self.discriminator = self.build_discriminator()
        self.discriminator.compile(loss=losses,
            optimizer=optimizer,
            metrics=['accuracy'])

        # Build the generator
        self.generator = self.build_generator()

        # The generator takes noise and the target label as input
        # and generates the corresponding digit of that label
        noise = …
Run Code Online (Sandbox Code Playgroud)

python machine-learning keras tensorflow tensorboard

5
推荐指数
1
解决办法
2110
查看次数

dataframe列中的值不会从string更改为float

所以我在数据框中有一个列,它填充了浮点值和偶尔的字符串值.我试过在堆栈上关注一些答案,但它不起作用.

print(data['Snowfall'][48609]) #prints #VALUE!
print(type(data['Snowfall'][48609])) #prints <class 'str'>
data['Snowfall'].str.contains("#VALUE!").replace(float(0.0),inplace=True)
print(type(data['Snowfall'][48609])) # prints <class 'str'>
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么

python pandas

2
推荐指数
1
解决办法
69
查看次数