Web platform for sharing free image data for ML and research

Homepage: https://datasets.roundabout-host.com

Highlight selected shape

by roundabout, Saturday, 4 January 2025, 14:54:38 (1736002478), pushed by roundabout, Saturday, 4 January 2025, 14:54:40 (1736002480)

Author identity: vlad <vlad.muntoiu@gmail.com>

c04b5ab5634da50d1b5b55305af0aca491b1918d

static/picture-annotation.py

@@ -392,6 +392,10 @@ def switch_shape(event):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                unselect_shape(None)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                shape = event.currentTarget.id
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                shape_type = shape
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            for button in list(document.getElementById("shape-selector").children):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                if not button.classList.contains("button-flat"):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    button.classList.add("button-flat")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            event.currentTarget.classList.remove("button-flat")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                if shape_type == "select":
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    # Add event listeners to existing shapes
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    print(len(list(document.getElementsByClassName("shape"))), "shapes found")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -419,7 +423,6 @@ def switch_shape(event):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def select_mode():
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                global shape_type
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            shape_type = "select"
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                document.getElementById("select").click()