Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	
		Anne Marthe Sophie Ngo Bibinbe
		
	commited on
		
		
					Commit 
							
							·
						
						419a2a6
	
1
								Parent(s):
							
							065a535
								
promptTrack installed
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -185,12 +185,16 @@ def process_video(video_path, prompt): 
     | 
|
| 185 | 
         
             
                output_video = video_path.split('mp4')[0]+"_with_id.mp4"  # Placeholder for processed video
         
     | 
| 186 | 
         
             
                output_file = video_path.split('mp4')[0]+"_mot_.json"    # Tracking result
         
     | 
| 187 | 
         
             
                output_file_2 = video_path.split('mp4')[0]+"_object_detection.json"    # detection results
         
     | 
| 188 | 
         
            -
             
     | 
| 189 | 
         
             
                video_file = video_path
         
     | 
| 190 | 
         
             
                """tracker.detect_objects(video_file, prompt=prompt, nms_threshold=0.8, detection_threshold=detection_threshold, detector="OWL-VITV2")
         
     | 
| 191 | 
         
             
                tracker.process_mot(video_file, fixed_parc=True, track_thresh=track_thresh, match_thresh=match_thresh, frame_rate=25, max_time_lost=max_time_lost, nbr_frames_fixing=nbr_frames_fixing)
         
     | 
| 192 | 
         
             
                tracker.read_video_with_mot(video_file, fps=25)
         
     | 
| 193 | 
         
             
                """
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 194 | 
         
             
                # Copy the input video to simulate processing
         
     | 
| 195 | 
         
             
                shutil.copy(video_path, output_video)
         
     | 
| 196 | 
         | 
| 
         @@ -212,4 +216,4 @@ iface = gr.Interface( 
     | 
|
| 212 | 
         | 
| 213 | 
         
             
            # Launch the app
         
     | 
| 214 | 
         
             
            if __name__ == "__main__":
         
     | 
| 215 | 
         
            -
                iface.launch() 
     | 
| 
         | 
|
| 185 | 
         
             
                output_video = video_path.split('mp4')[0]+"_with_id.mp4"  # Placeholder for processed video
         
     | 
| 186 | 
         
             
                output_file = video_path.split('mp4')[0]+"_mot_.json"    # Tracking result
         
     | 
| 187 | 
         
             
                output_file_2 = video_path.split('mp4')[0]+"_object_detection.json"    # detection results
         
     | 
| 
         | 
|
| 188 | 
         
             
                video_file = video_path
         
     | 
| 189 | 
         
             
                """tracker.detect_objects(video_file, prompt=prompt, nms_threshold=0.8, detection_threshold=detection_threshold, detector="OWL-VITV2")
         
     | 
| 190 | 
         
             
                tracker.process_mot(video_file, fixed_parc=True, track_thresh=track_thresh, match_thresh=match_thresh, frame_rate=25, max_time_lost=max_time_lost, nbr_frames_fixing=nbr_frames_fixing)
         
     | 
| 191 | 
         
             
                tracker.read_video_with_mot(video_file, fps=25)
         
     | 
| 192 | 
         
             
                """
         
     | 
| 193 | 
         
            +
                
         
     | 
| 194 | 
         
            +
                output_video = "output.mp4"  # Placeholder for processed video
         
     | 
| 195 | 
         
            +
                output_file = "output.txt"    # Placeholder for generated file
         
     | 
| 196 | 
         
            +
                
         
     | 
| 197 | 
         
            +
                
         
     | 
| 198 | 
         
             
                # Copy the input video to simulate processing
         
     | 
| 199 | 
         
             
                shutil.copy(video_path, output_video)
         
     | 
| 200 | 
         | 
| 
         | 
|
| 216 | 
         | 
| 217 | 
         
             
            # Launch the app
         
     | 
| 218 | 
         
             
            if __name__ == "__main__":
         
     | 
| 219 | 
         
            +
                iface.launch()
         
     |