Hello, thank you for using the code provided by CloudFactory. Please note that some code blocks might not be 100% complete and ready to be run as is. This is done intentionally as we focus on implementing only the most challenging parts that might be tough to pick up from scratch. View our code block as a LEGO block - you can’t use it as a standalone solution, but you can take it and add it to your system to complement it.
As an example, here are two annotations, one bounding box (cat) and one polygon (dining table):
Hello, thank you for using the code provided by CloudFactory. Please note that some code blocks might not be 100% complete and ready to be run as is. This is done intentionally as we focus on implementing only the most challenging parts that might be tough to pick up from scratch. View our code block as a LEGO block - you can’t use it as a standalone solution, but you can take it and add it to your system to complement it.
Each file with a semantic segmentation should be an image in *.png
format. The filename should be the same (without extension) as the
corresponding image's name. The image file can contain one or three
channels.
Label classes can be imported through the use of a JSON-file with in the following schema:
Hello, thank you for using the code provided by CloudFactory. Please note that some code blocks might not be 100% complete and ready to be run as is. This is done intentionally as we focus on implementing only the most challenging parts that might be tough to pick up from scratch. View our code block as a LEGO block - you can’t use it as a standalone solution, but you can take it and add it to your system to complement it.
Hello, thank you for using the code provided by CloudFactory. Please note that some code blocks might not be 100% complete and ready to be run as is. This is done intentionally as we focus on implementing only the most challenging parts that might be tough to pick up from scratch. View our code block as a LEGO block - you can’t use it as a standalone solution, but you can take it and add it to your system to complement it.
As you can see, there are two types of classes: object (1) and
background (2). These correspond to the foreground (1) and semantic (2)
classes you see in the tool.
Hello, thank you for using the code provided by CloudFactory. Please note that some code blocks might not be 100% complete and ready to be run as is. This is done intentionally as we focus on implementing only the most challenging parts that might be tough to pick up from scratch. View our code block as a LEGO block - you can’t use it as a standalone solution, but you can take it and add it to your system to complement it.
python
defrle_encoding(x: np.array):"""
Encode binary mask to RLE
Args:
x (np.array): numpy array of shape (height, width), 1 - mask, 0 - background
Returns run length as list
"""
dots = np.where(x.flatten() == 1)[0] # Order right-then-down
run_lengths = []
prev = -2for b in dots:
if b > prev + 1:
run_lengths.extend((b + 1, 0))
run_lengths[-1] += 1
prev = b
return run_lengths
If you are looking to import masks or do other, more complex imports with attributes and image tags as well as annotations, you need to format your data into our own supported Hasty JSON v1.1.
Boost model performance quickly with AI-powered labeling and 100% QA.