Skip to content

Deleting human labeled features by location in space. #1033

Answered by roomrys
catubc asked this question in Help!
Discussion options

You must be logged in to vote

Hi @catubc,

Through the SLEAP API, you can access the points of instances in a certain area and remove instances meeting a certain criteria:

import sleap

ds = "path/to/slp"
labels = sleap.load_file(ds)

labels.videos  # Use in ipython to print list of videos in the labels object
video_idx = 0  # Change this select the video of interest from the labels.video list
video = labels.videos[video_idx]
labeled_frames_from_video = labels.get(video)

# Loop through all labeled frames (from a specific video)
for lf in labeled_frames_from_video:
    # Loop through all user instances in the current labeled frame
    for inst in lf.user_instances:
        remove_inst = False
        points_array = inst.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@roomrys
Comment options

Comment options

You must be logged in to vote
1 reply
@catubc
Comment options

Answer selected by catubc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help!
Labels
None yet
2 participants