Giter Club home page Giter Club logo

pixellink-with-pytorch's People

Contributors

cheerss 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

Watchers

 avatar  avatar  avatar  avatar

pixellink-with-pytorch's Issues

A tiny change

In datasets.py line 351: "label = sample['label'].reshape([-1, 4, 2])", should be changed to "label = np.array(sample['label']['coor']).reshape([-1, 4, 2])".

Because sample['label'] is dict type, and it only need coordinates to draw the contours.

IndexError: index 2 is out of bounds for dimension 0 with size 2

hello,
Thanks for your sharing, I modify your code to complete my task based on pytorch. After fininshed my training process to test, it appears an error which is "IndexError: index 2 is out of bounds for dimension 0 with size 2"
Traceback (most recent call last):
File "main.py", line 184, in
test_model()
File "main.py", line 51, in test_model
all_boxes = postprocess.mask_to_box(out_1, out_2)
File "/home/liuchao/PixelLink-with-pytorch/postprocess.py", line 59, in mask_to_box
link_neighbors[:, i] = link_neighbors[:, i] & pixel_class[i]
IndexError: index 2 is out of bounds for dimension 0 with size 2
I'm grateful for u to help me solve the error above,Thanks~

Problem in training.

File "main.py", line 138, in
main()
File "main.py", line 128, in main
train(config.epoch, iteration, dataloader, my_net, optimizer, optimizer2, device)
File "main.py", line 59, in train
for i_batch, sample in enumerate(dataloader):
File "/home/denny/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 317, in next
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/home/denny/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 317, in
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/home/denny/github_open_Sources/PixelLink-with-pytorch/datasets.py", line 84, in getitem
image, label = self.train_data_transform(index)
File "/home/denny/github_open_Sources/PixelLink-with-pytorch/datasets.py", line 103, in train_data_transform
img = self.read_image(self.images_dir, index)
File "/home/denny/github_open_Sources/PixelLink-with-pytorch/datasets.py", line 34, in read_image
image = ImgTransform.ReadImage(filename)
File "/home/denny/github_open_Sources/PixelLink-with-pytorch/ImgLib/ImgTransform.py", line 16, in ReadImage
with Image.open(filename) as img:
File "/home/denny/anaconda3/envs/pytorch/lib/python3.6/site-packages/PIL/Image.py", line 2609, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'training_images/images/img_tensor(956).jpg'

Is there any update?How can i test?

hello, thanks for your codes and am interested in it..
As you said this version is still under developing, is there any new updates?
I didn't find the functions for testing and this version can only train IC15 dataset, right?
When will you upload new codes...really looking forward your reply.
Thanks again!!

iteration 12: pixel_loss: nan, link_loss: nan, total loss: nan, time: 3.7550010681152344

我改了数据加载这里,看了下没啥问题,为啥会爆炸呢?请指教一下
reade_label()
with codecs.open(os.path.join(dir, self.labels_name[i-1]), encoding="utf-8_sig") as file:
data = file.readlines()
temp_str = ''
for l in data:
temp_str += l.strip('\r\n')
temp_json = json.loads(temp_str)
tmp = {}
tmp["coor"] = []
tmp["content"] = []
tmp["ignore"] = []
tmp["area"] = []
for line in temp_json["shapes"]:
tmp["content"].append(line["label"])
if line["label"] == "###":
tmp["ignore"].append(True)
else:
tmp["ignore"].append(False)
coor = []
if len(line["points"]) != 4:
print(os.path.join(dir, self.labels_name[i - 1]))
print(line["points"])
for n in line["points"]:
coor.append(int(n[0]))
coor.append(int(n[1]))
tmp["coor"].append(coor)
coor = np.array(coor).reshape([4, 2])
tmp["area"].append(cv2.contourArea(coor))

            # for line in data:
            #     content = line.split(",")
            #     coor = [int(n) for n in content[:8]]
            #
            #     content[8] = content[8].strip("\r\n")
            #     tmp["content"].append(content[8])
            #     if content[8] == "###":
            #         tmp["ignore"].append(True)
            #     else:
            #         tmp["ignore"].append(False)
            #     coor = np.array(coor).reshape([4,2])
            #     tmp["area"].append(cv2.contourArea(coor))
            res[i-1] = tmp
    return res

另外,请问加载图像时index为什么加1,我把加1去掉了?

index += 1

    filename = os.path.join(dir, self.images_name[index] + ".jpg")

Pretrained model

Sorry but where can I download the pretrained model, or which version do I need?

cuda out of memory

when I train this model, it happened this situation. And I have a RTX 1080 Ti with 12GB memory.

自己训练的precision

我用你的代码跑了下ICDAR 2015的数据集,
loss降到这么多时
image
在训练集上的测试结果如下,
image
这是因为我的还没收敛吗?我第一次训练文本检测的,不知道loss降到什么时候是收敛好了

Problem in Loss Func. Use ICDAR2015 to train to model, but this problem emerged.

File "/workspace/PixelLink-with-pytorch/main.py", line 144, in
main()
File "/workspace/PixelLink-with-pytorch/main.py", line 133, in main
train(config.epoch, iteration, dataloader, my_net, optimizer, optimizer2, device)
File "/workspace/PixelLink-with-pytorch/main.py", line 73, in train
pixel_pos_weights)
File "/workspace/PixelLink-with-pytorch/criterion.py", line 46, in pixel_loss
self.neg_pixel_weight[i] = self.neg_pixel_weight[i] & (neg_pixel_masks[i]==1)
RuntimeError: Expected object of scalar type Byte but got scalar type Bool for argument #2 'other' in call to _th_and

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.