Comments (6)
Sorry for disturbing, I found the reason of the bug, it came from a invalid annotation. I fix the issue by double-check the labels. Here is the script to figure out the invalid points.
from shapely.geometry import Polygon, LinearRing
import glob
import random
anno_root = 'annotations/training/'
filelist = glob.glob(anno_root+"*.txt")
assert len(filelist) > 0
def check_polygon(filename):
t = open(filename)
for line in t.readlines():
cors = line.strip().split(',')
assert (len(cors) % 2) == 0, "invalid cors"
pts = [(int(cors[j]), int(cors[j+1])) for j in range(0, len(cors)-1, 2)]
try:
pgt = Polygon(pts)
except Exception as e:
print('Not a valid polygon', pgt)
continue
if not pgt.is_valid:
print('GT polygon has intersecting sides', pts)
continue
pRing = LinearRing(pts)
if not pRing.is_ccw:
pts.reverse()
t.close()
# test
check_polygon(random.choice(filelist))
for i in filelist:
check_polygon(i)
from mmocr.
@Bovey0809 Hi. I have the same problem. This error shows what is wrong with the data? I have filtered the data with your check code, but I still have this problem.
line 205, in resample_line
while current_line_len >= length_cumsum[current_edge_ind + 1]:
IndexError: index 3 is out of bounds for axis 0 with size 3
from mmocr.
@FFoCC Thanks for your feedback. Could you provide the polyline data that the code wrongly processed?
from mmocr.
@HolyCrap96 I don't know which piece of data is wrong. It is strange that sometimes my dataset can work with three epochs and a fourth error.
from mmocr.
@HolyCrap96 Here are two examples of my data. Is there anything wrong with them?
{"file_name": "training/210519_0670.jpg", "height": 3968, "width": 2976, "annotations": [{"iscrowd": 0, "category_id": 1, "bbox": [897.0, 914.0, 578.0, 139.0], "segmentation": [[897, 914, 1475, 914, 1475, 1053, 897, 1053]]}, {"iscrowd": 0, "category_id": 1, "bbox": [918.0, 2081.0, 1079.0, 187.0], "segmentation": [[923, 2142, 1143, 2128, 1178, 2122, 1409, 2132, 1476, 2123, 1538, 2123, 1572, 2126, 1595, 2123, 1621, 2114, 1641, 2114, 1660, 2109, 1709, 2099, 1893, 2084, 1957, 2081, 1997, 2172, 1956, 2199, 1884, 2218, 1812, 2240, 1145, 2264, 969, 2268, 918, 2263]]}, {"iscrowd": 0, "category_id": 1, "bbox": [1087.0, 1260.0, 420.0, 178.0], "segmentation": [[1087, 1260, 1507, 1260, 1507, 1438, 1087, 1438]]}, {"iscrowd": 0, "category_id": 1, "bbox": [1132.0, 2468.0, 428.0, 165.0], "segmentation": [[1132, 2468, 1560, 2468, 1560, 2633, 1132, 2633]]}, {"iscrowd": 0, "category_id": 1, "bbox": [2086.0, 287.0, 237.0, 137.0], "segmentation": [[2086, 287, 2323, 287, 2323, 424, 2086, 424]]}]}
{"file_name": "training/397756.jpg", "height": 1800, "width": 850, "annotations": [{"iscrowd": 0, "category_id": 1, "bbox": [314.0, 829.0, 77.0, 27.0], "segmentation": [[314, 829, 391, 829, 391, 856, 314, 856]]}, {"iscrowd": 0, "category_id": 1, "bbox": [399.0, 826.0, 27.0, 31.0], "segmentation": [[399, 826, 426, 826, 426, 857, 399, 857]]}, {"iscrowd": 0, "category_id": 1, "bbox": [225.0, 909.0, 227.0, 48.0], "segmentation": [[225, 925, 445, 909, 452, 942, 229, 957]]}, {"iscrowd": 0, "category_id": 1, "bbox": [276.0, 1008.0, 116.0, 30.0], "segmentation": [[276, 1008, 392, 1008, 392, 1038, 276, 1038]]}, {"iscrowd": 0, "category_id": 1, "bbox": [252.0, 1089.0, 124.0, 49.0], "segmentation": [[252, 1089, 376, 1089, 376, 1138, 252, 1138]]}, {"iscrowd": 0, "category_id": 1, "bbox": [819.0, 471.0, 31.0, 43.0], "segmentation": [[819, 471, 850, 471, 850, 514, 819, 514]]}]}
from mmocr.
Probably get fixed in #448, which is a part of MMOCR 0.3.0.
from mmocr.
Related Issues (20)
- [Bug] AssertionError: MMDetection 3.2.0 is incompatible with MMOCR 1.0.1. HOT 5
- [Bug] MMDETECTION is incompatible with MMOCR HOT 5
- [Bug] how to use api of spts and abcnet algorithm by mmocrinferencer?
- [Bug] TypeError: '>' not supported between instances of 'list' and 'float' HOT 1
- [Bug] MMOCR fails to install using MIM HOT 3
- [Feature] How to add ignore dataset
- SPTS has filepaths which are not explained to what they are
- browse_dataset.py编码问题
- [Feature] Support rotating rect for annoation
- [Feature] implementation for device cuda:0 not found
- [Bug] Training ABCNet but the e2e indicators are all 0 HOT 11
- [Bug] MMOCRInferencer cropped image 0 size which breaks the recognition
- [Feature] image_to_string function
- [Bug] MMCV==2.1.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0. HOT 9
- Combine Detector and Recognizer Classes into a unified Class
- can we do inferencing on the video to detect text
- Syn90k与SynthText 太大了,有无好点的下载地址。 HOT 1
- [Bug] How can Abinet support uppercase English
- [Bug] error: metadata-generation-failed HOT 1
- [Docs] tools/analysis_tools/browse_dataset.py does not exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmocr.