Giter VIP home page Giter VIP logo

remote-sensing-image-semantic-segmentation's Introduction

Remote-sensing-image-semantic-segmentation

The project uses Unet-based improved networks to study Remote sensing image semantic segmentation, which is based on keras.
This project has been used in the Sparse Representation and Intelligent Analysis of 2019 Remote Sensing Image competition.


Requirements

  • python 3.6.8
  • tensorflow-gpu 1.8
  • Keras 2.2.4
  • opencv-python
  • tqdm
  • numpy
  • glob
  • argparse
  • matplotlib
  • tifffile
  • pyjson
  • Pillow 6.0
  • scikit-learn

Usage

1. Download dataset

Link,key:1d4x

2. Create new labels

python create_train_val_label.py

3. Train

eg. python train6_6.py --model checkpoint6_6

4. Download pre-trained weights

Link

5. Test

eg. python test.py --model 'checkpoint6_6'+ '/' + 'weights-039-0.7205-0.8099.h5'

Results

Since the original remote sensing image is too large, a partial screenshot of the test results is given here.

remote-sensing-image-semantic-segmentation's People

Contributors

tachibanayoshino 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

remote-sensing-image-semantic-segmentation's Issues

关于模型训练

你好,我再使用您模型训练的时候,遇到总是卡在model.fit()那一步,训练开始后不打印任何信息,让我感觉像是卡了一样,请问这正常吗?

请问网络层为什么要使用多个尺寸的label呢?

    out1 = Activation('softmax',name='l1')(Reshape((400 * 400, n_label))(R_out4))
    out2 = Activation('softmax',name='l2')(Reshape((200 * 200, n_label))(R_out3))
    out3 = Activation('softmax',name='l3')(Reshape((100 * 100, n_label))(R_out2))
    out4 = Activation('softmax',name='l4')(Reshape((50 * 50, n_label))(R_out1))

请问网络层为什么要使用多个尺寸的label呢?
另外,您在推理预测的时候,好像并没有使用到多尺寸的pred

                pred = model.predict(crop,verbose=2)
                pred = pred[0]
                pred = np.reshape(pred, (1, c.size_train[1] * c.size_train[0], c.n_label))
                pred = np.argmax(pred, axis=2)

create_train_val_label.py 将label由rgb转为单个值很慢,借助numpy可快速转换

实现:
def get_label_from_palette(label_img, palette_file='Palette.json'):
with open(palette_file, 'r') as fp:
text = json.load(fp)
palette_values = np.array(list(text.values()))
palette_keys = np.array(list(text.keys()))
# 将三维RGB图像展平为二维形状
flat_label_img = label_img.reshape((-1, 3))

    mask = np.all(np.equal(palette_values, flat_label_img[:, None]), axis=2)
    indices = np.where(mask)
    labels = palette_keys[indices[1]]
    # 将标签重新形状为与原始图像相同
    label = labels.reshape(label_img.shape[:2])

    return label.astype(np.uint8)

img.resize for 4bands image?

@TachibanaYoshino
我看您用了PIL的resize函数对图像进行重采样,请问四波段影像是不是不能这样重采样?有没有什么好的方法进行重采样?
歇息
img, label = img.resize((c.size_train[1], c.size_train[0]), Image.ANTIALIAS), label.resize(
(c.size_train[1], c.size_train[0]), Image.BILINEAR)

数据集问题

发现了数据集好像不太对,是做过什么处理吗?
数据中有(0,0,0)值,并且地物颜色与真实的也不一致。

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.