Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23247

how can i modify 3 chanenls train image to 4channels in mmdetection?

$
0
0

I want to train 4channels image in mmdetection. But I don't know how to modify codes.

How can I do this?

First, I tried to modify call function in class LoadImageFromFile in mmdetection/mmdet/datasets/pipelines/loading.py, but I got error.

    def __call__(self, results):        ......        results['filename'] = filename        results['ori_filename'] = results['img_info']['filename']        results['img'] = img        results['img_shape'] = img.shape        results['ori_shape'] = img.shape        results['img_fields'] = ['img']        return results

Second, I tried to modify getitem function in class CustomDatset in mmdetection/mmdet/datasets/custom.py

        if self.test_mode:            return self.prepare_test_img(idx)        while True:            data = self.prepare_train_img(idx)            if data is None:                idx = self._rand_another(idx)                continue            return data

I modified data['img'] to custom image, but I failed.


Viewing all articles
Browse latest Browse all 23247

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>