Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	
		Haobo Yuan
		
	commited on
		
		
					Commit 
							
							·
						
						5f78ef5
	
1
								Parent(s):
							
							976cbed
								
add Zero Support
Browse files- main.py +3 -1
 - requirements.txt +3 -2
 
    	
        main.py
    CHANGED
    
    | 
         @@ -17,6 +17,8 @@ from mmdet.datasets.coco_panoptic import CocoPanopticDataset 
     | 
|
| 17 | 
         | 
| 18 | 
         
             
            from PIL import ImageDraw
         
     | 
| 19 | 
         | 
| 
         | 
|
| 
         | 
|
| 20 | 
         
             
            IMG_SIZE = 1024
         
     | 
| 21 | 
         | 
| 22 | 
         
             
            TITLE = "<center><strong><font size='8'>OMG-Seg: Is One Model Good Enough For All Segmentation?<font></strong></center>"
         
     | 
| 
         @@ -106,7 +108,7 @@ def get_points_with_draw(image, img_state, evt: gr.SelectData): 
     | 
|
| 106 | 
         
             
                )
         
     | 
| 107 | 
         
             
                return image
         
     | 
| 108 | 
         | 
| 109 | 
         
            -
             
     | 
| 110 | 
         
             
            def segment_point(image, img_state, mode):
         
     | 
| 111 | 
         
             
                output_img = img_state.img
         
     | 
| 112 | 
         
             
                h, w = output_img.shape[:2]
         
     | 
| 
         | 
|
| 17 | 
         | 
| 18 | 
         
             
            from PIL import ImageDraw
         
     | 
| 19 | 
         | 
| 20 | 
         
            +
            import spaces
         
     | 
| 21 | 
         
            +
             
     | 
| 22 | 
         
             
            IMG_SIZE = 1024
         
     | 
| 23 | 
         | 
| 24 | 
         
             
            TITLE = "<center><strong><font size='8'>OMG-Seg: Is One Model Good Enough For All Segmentation?<font></strong></center>"
         
     | 
| 
         | 
|
| 108 | 
         
             
                )
         
     | 
| 109 | 
         
             
                return image
         
     | 
| 110 | 
         | 
| 111 | 
         
            +
            @spaces.GPU()
         
     | 
| 112 | 
         
             
            def segment_point(image, img_state, mode):
         
     | 
| 113 | 
         
             
                output_img = img_state.img
         
     | 
| 114 | 
         
             
                h, w = output_img.shape[:2]
         
     | 
    	
        requirements.txt
    CHANGED
    
    | 
         @@ -1,6 +1,7 @@ 
     | 
|
| 1 | 
         
            -
            -f https://download.openmmlab.com/mmcv/dist/ 
     | 
| 
         | 
|
| 2 | 
         | 
| 3 | 
         
            -
            torch==2.1 
     | 
| 4 | 
         
             
            torchvision
         
     | 
| 5 | 
         
             
            mmengine==0.10.2
         
     | 
| 6 | 
         
             
            mmcv==2.1.0
         
     | 
| 
         | 
|
| 1 | 
         
            +
            -f https://download.openmmlab.com/mmcv/dist/cu117/torch2.0.0/index.html
         
     | 
| 2 | 
         
            +
            -f https://download.pytorch.org/whl/cu117
         
     | 
| 3 | 
         | 
| 4 | 
         
            +
            torch==2.0.1
         
     | 
| 5 | 
         
             
            torchvision
         
     | 
| 6 | 
         
             
            mmengine==0.10.2
         
     | 
| 7 | 
         
             
            mmcv==2.1.0
         
     |