Code Monkey home page Code Monkey logo

change_detection.pytorch's Introduction

likyoo

linux docker python pytorch

 likyoo

Hi there 👋

My research interests are in computer vision, vision-language model and remote sensing image processing.

Page: https://likyoo.github.io/

change_detection.pytorch's People

Contributors

dpxudong avatar elyar-adil avatar likyoo avatar linosun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

change_detection.pytorch's Issues

principle of network

Can you tell me the implementation principle of this change detection network?

BCL

There is a bcl.py in losses but it is not compatible with the package and I received error. Could you please advise?

TFLite export

Hi! Thank you for this repo! I want to use these models in an App. Have you considered adding exporting functionality to TFLite?

当你的输入图片不是32的倍数时,调用Unet和Unet++会报错。

warnings.warn("pyprof will be removed by the end of June, 2022", FutureWarning)
Traceback (most recent call last):
File "D:/WorkSpace/PythonWorkSpace/change_detection/test.py", line 60, in
y_pred = model(img1, img2)
File "D:\Software\Anconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "D:\WorkSpace\PythonWorkSpace\change_detection\change_detection_pytorch\base\model.py", line 35, in forward
return self.base_forward(x1, x2)
File "D:\WorkSpace\PythonWorkSpace\change_detection\change_detection_pytorch\base\model.py", line 20, in base_forward
decoder_output = self.decoder(*features)
File "D:\Software\Anconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "D:\WorkSpace\PythonWorkSpace\change_detection\change_detection_pytorch\unetplusplus\decoder.py", line 137, in forward
output = self.blocks[f'x
{depth_idx}
{depth_idx}'](features[depth_idx], features[depth_idx+1])
File "D:\Software\Anconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "D:\WorkSpace\PythonWorkSpace\change_detection\change_detection_pytorch\unetplusplus\decoder.py", line 39, in forward
x = torch.cat([x, skip], dim=1)
RuntimeError: Sizes of tensors must match except in dimension 2. Got 49 and 50 (The offending index is 0)
RuntimeError: Sizes of tensors must match except in dimension 2. Got 49 and 50 (The offending index is 0)

Roadmap of cdp

We keep this issue open to collect feature requests from users and hear your voice. Our release plan is also available here.

You can either:

Suggest a new feature by leaving a comment.
Vote for a feature request with 👍 or be against with 👎.
Tell us that you would like to help implement one of the features in the list or review the PRs. (This is the greatest things to hear about!:laughing:)

In the final step, “infer_vis” can't work.

In the verification step of the last step, each “tiff” cannot be opened, which causes the program to end directly and cannot view the accuracy. I guess it's the "infer_vis" problem, have you ever encountered this situation?

使用灰度图像报错

在使用unet模型的时候 将输入的通道改成1后,报错
RuntimeError: Given groups=1, weight of size [64, 1, 7, 7], expected input[8, 3, 256, 256] to have 1 channels, but got 3 channels instead
M )@0XTIC8MFCVG10OT`ME5

但是我的图像确实是但通道的 是我还需要修改某些地方吗

dimensional error

您好,我在运行local_test.py文件时出现了错误,而我一直解决不了,错误如下:
RuntimeError: Expected 4-dimensional input for 4-dimensional weight [64, 3, 7, 7], but got 3-dimensional input of size [3, 256, 256] instead 我想知道[6,3,7,7]代表的是什么?
这个错误是发生在valed部分,在执行epoch1时train可以正常读取图片并运行,但到valed就报错了,希望能获得您的建议。

Suggest to loosen the dependency on albumentations

Hi, your project change_detection.pytorch(commit id: 0a86d51) requires "albumentations==1.0.3" in its dependency. After analyzing the source code, we found that the following versions of albumentations can also be suitable, i.e., albumentations 1.0.0, 1.0.1, 1.0.2, since all functions that you directly (8 APIs: albumentations.core.transforms_interface.BasicTransform.init, albumentations.augmentations.geometric.resize.Resize.init, albumentations.core.composition.Compose.init, albumentations.pytorch.transforms.ToTensorV2.init, albumentations.augmentations.crops.functional.random_crop, albumentations.core.transforms_interface.DualTransform.init, albumentations.augmentations.crops.transforms.RandomCrop.init, albumentations.augmentations.transforms.Normalize.init) or indirectly (propagate to 11 albumentations's internal APIs and 0 outsider APIs) used from the package have not been changed in these versions, thus not affecting your usage.

Therefore, we believe that it is quite safe to loose your dependency on albumentations from "albumentations==1.0.3" to "albumentations>=1.0.0,<=1.0.3". This will improve the applicability of change_detection.pytorch and reduce the possibility of any further dependency conflict with other projects.

May I pull a request to further loosen the dependency on albumentations?

By the way, could you please tell us whether such an automatic tool for dependency analysis may be potentially helpful for maintaining dependencies easier during your development?

Load trained model weigths

Hi @likyoo ,

I study with yoru repo for my project.I have been added to new features to your repo.I'll share it with you when I'm done.

But I have a significant question;

How can I load weigths after training operation?

使用自己的数据集报错,哪里出了问题,如何解决

Epoch: 0
train: 0%| | 0/269 [05:14<?, ?it/s]
Traceback (most recent call last):
File "/home/Faith/anaconda3/envs/d2l/lib/python3.8/runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/Faith/anaconda3/envs/d2l/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/Faith/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py", line 39, in
cli.main()
File "/home/Faith/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/home/Faith/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="main")
File "/home/Faith/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/Faith/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/Faith/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/home/Faith/project/sim/Siamese-pytorch-bilibili/change_detection_pytorch/local_test.py", line 82, in
train_logs = train_epoch.run(train_loader)
File "/home/Faith/project/sim/Siamese-pytorch-bilibili/change_detection_pytorch/change_detection_pytorch/utils/train.py", line 114, in run
for (x1, x2, y, filename) in iterator:
File "/home/Faith/anaconda3/envs/d2l/lib/python3.8/site-packages/tqdm/std.py", line 1178, in iter
for obj in iterable:
File "/home/Faith/anaconda3/envs/d2l/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 634, in next
data = self._next_data()
File "/home/Faith/anaconda3/envs/d2l/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 678, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/Faith/anaconda3/envs/d2l/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/Faith/anaconda3/envs/d2l/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/Faith/project/sim/Siamese-pytorch-bilibili/change_detection_pytorch/change_detection_pytorch/datasets/LEVIR_CD.py", line 54, in getitem
img1, img2, ann, filename = self.prepare_img_ann(idx)
File "/home/Faith/project/sim/Siamese-pytorch-bilibili/change_detection_pytorch/change_detection_pytorch/datasets/custom.py", line 217, in prepare_img_ann
img1, img2 = self.get_image(img_info)
File "/home/Faith/project/sim/Siamese-pytorch-bilibili/change_detection_pytorch/change_detection_pytorch/datasets/custom.py", line 178, in get_image
img2 = cv2.cvtColor(cv2.imread(img_info['img']['img2_path']), cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(4.8.1) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

微信群的二维码失效了

开宇大神你好,😃
你在readme里公开的变化检测交流群的二维码失效了,可否更新一下,希望能加入变化检测大家庭,一起讨论。
感谢!👍
608b2e4d4a12302641d5f547a78f8f2

缺少单独调用模型用于测试的脚本

可以单独提供一个用于测试新的两张输入图片的脚本吗?
我已经训练好了模型,并且在最后一步infer_vis出来的验证图片效果不错
image
但是缺乏一个可以单独调用模型用于测试的脚本,请问作者有什么解决办法或者可以提供一下代码吗

How to test on new images?

Dear @likyoo thanks for your open source project. I have trained models and saved the best model. Now, how can I test model on new images (not validation)

Evaluation with different thresholds give the same results

This piece of code :

for x in np.arange(0.6, 0.9, 0.1):
    print('Eval with TH:', x)
    metrics = [
        cdp.utils.metrics.Fscore(activation='argmax2d', threshold=x),
        cdp.utils.metrics.Precision(activation='argmax2d', threshold=x),
        cdp.utils.metrics.Recall(activation='argmax2d', threshold=x),
    ]

    valid_epoch = cdp.utils.train.ValidEpoch(
        model,
        loss=loss,
        metrics=metrics,
        device=DEVICE,
        verbose=True,
    )

    valid_logs = valid_epoch.run(valid_loader)
    print(valid_logs)

Give me the following result:

Eval with TH: 0.6
valid: 100%|█████████████████████████████████████████████████████████████| 505/505 [01:12<00:00,  6.98it/s, cross_entropy_loss - 0.08708, fscore - 0.8799, precision - 0.8946, recall - 0.8789]
{'cross_entropy_loss': 0.0870812193864016, 'fscore': 0.8798528309538921, 'precision': 0.8946225793644936, 'recall': 0.8789094516579565}

Eval with TH: 0.7
valid: 100%|█████████████████████████████████████████████████████████████| 505/505 [01:12<00:00,  6.99it/s, cross_entropy_loss - 0.08708, fscore - 0.8799, precision - 0.8946, recall - 0.8789]
{'cross_entropy_loss': 0.08708121913835626, 'fscore': 0.8798528309538921, 'precision': 0.8946225793644936, 'recall': 0.8789094516579565}

Eval with TH: 0.7999999999999999
valid: 100%|█████████████████████████████████████████████████████████████| 505/505 [01:11<00:00,  7.02it/s, cross_entropy_loss - 0.08708, fscore - 0.8799, precision - 0.8946, recall - 0.8789]
{'cross_entropy_loss': 0.08708121978843793, 'fscore': 0.8798528309538921, 'precision': 0.8946225793644936, 'recall': 0.8789094516579565}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.