Ask a Question
Not able to download my Dataset
Not able to download my Dataset named as scikle
Posted by Vipin Rathi 4 months ago
Specify the appropriate format for the binary image to be used as an annotation.
```
def convert_mask_to_annotation(mask_path, class_id=0):
mask = Image.open(mask_path)
mask = np.array(mask)
labels = measure.label(mask)
annotations = []
# Find the contours of each object
for region in measure.regionprops(labels):
# Skip small regions
if region.area < 20:
print(f"Skipping region {region.label} due to small area ({region.area}).")
continue
# Invert the mask for this region
inverted_mask = cv2.bitwise_not((mask == region.label).astype(np.uint8) * 255)
# Find the contour of the region
contours, _ = cv2.findContours(
inverted_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE
)
if len(contours) == 0:
print(f"No contour found for region with label {region.label}. Skipping.")
continue
# Take the largest contour by area
largest_contour = max(contours, key=cv2.contourArea)
# Convert the contour to a SuperAnnotate polygon
polygon = [point[0] for point in largest_contour]
# Convert the polygon points to a list of dictionaries
polygon = [{"x": point[0], "y": point[1]} for point in polygon]
annotation = {
"classId": class_id, # Assuming class_id is the correct integer ID for the class.
"points": polygon,
"groupId": 0,
"groupName": "example",
"attributes": [],
"probability": 100,
"locked": False,
"visible": True,
"imageName": os.path.basename(mask_path).replace(".png", ".jpg"),
"imageWidth": mask.shape[1],
"imageHeight": mask.shape[0],
}
annotations.append(annotation)
return annotations
```
I am trying to upload annotations to my SuperAnnotate project using the Python SDK. However, the annotations are not being uploaded despite seemingly being generated correctly by my script. I have confirmed that my mask images do contain regions and I've tried to adjust the size threshold in my script, but this has not resolved the issue. Can you help me understand why the annotations might not be uploading correctly? Here is the output I receive when I run my script:
SA-PYTHON-SDK - INFO - Created project Example Project 1 (ID 137363) with type Vector.
SA-PYTHON-SDK - INFO - Uploading 0/5 annotations to the project Example Project 1.
Uploading Annotations: 0it [00:00, ?it/s]
SA-PYTHON-SDK - INFO - Uploading 0/4 annotations to the project Example Project 1.
Uploading Annotations: 0it [00:00, ?it/s]
SA-PYTHON-SDK - INFO - Uploading 0/7 annotations to the project Example Project 1.
Uploading Annotations: 0it [00:00, ?it/s]
Posted by Sameerah Talafha 4 months ago
latancy in the tool
my team facing latency issue in the tool, its taking more time while loading the images and while submitting it to QC its taking more time than normal. so please solve the issues as soon as possible .
Posted by Rajeev 4 months ago
What is the best way for me to learn Annotation?
Hi Folks, I know you have no current job openings but I need some guidance on how I can learn Annotation? There are so many online courses etc. I need some help here? I do have a computer science degree and did program but that was a while ago. So a little nervous about getting back into the game. I would love to hear from you and get some advice.
Thank you so much for your time!
Tracee
Posted by Tracee Freeman 4 months ago
Video editor labeling tool availability
Hi, I'm testing video labeling and object tracking. It seems as though the bounding box and polygon tool is disabled or unavailable. This seemed to work back in February during initial testing phase. Is there a way to turn the video editing tools/features on during integration or project folder set up?
Posted by Shanna 4 months ago
dicom file
I'm wondering whether dicom files can export as nii format (on enterprise version)
Posted by yun jihyeon 4 months ago
Measurement with polyline
Hello, I was wondering if there is a way for me to use the polyline tool and get automatic measurment without having to use the ruler option?
Posted by Cesar E. Escamilla-Ocanas 5 months ago
Magic Box Tool pop-up on OCR box
We applied a workflow to our one-class project to automatically set the single class for a newly drawn polygon. However, since this class has the OCR attribute, every time we pass an image, there is a pop-up ("You've selected a class with OCR. Select the Magic Box tool...") shown on the bottom left of the screen. It's blocking the view for a second and is slightly annoying. Is there any way to turn it off?
Posted by Azmi C. Ozgen 5 months ago
Deleting all classes
Is there any option to delete all classes from interface or API?
Posted by Azmi C. Ozgen 6 months ago
downloading data skips folder
I have three folders with annotations completed and quality checked and when I go to download the data only two folders and their annotations get downloaded, it skips the larger folder with approx 500 annotations.
Posted by Santosh Shriyan 6 months ago