mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	randomize the region multiplier for variation
This commit is contained in:
		
							parent
							
								
									338e4004d4
								
							
						
					
					
						commit
						87cd618998
					
				@ -3,6 +3,7 @@ import itertools
 | 
				
			|||||||
import logging
 | 
					import logging
 | 
				
			||||||
import multiprocessing as mp
 | 
					import multiprocessing as mp
 | 
				
			||||||
import queue
 | 
					import queue
 | 
				
			||||||
 | 
					import random
 | 
				
			||||||
import signal
 | 
					import signal
 | 
				
			||||||
import subprocess as sp
 | 
					import subprocess as sp
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
@ -532,13 +533,23 @@ def process_frames(
 | 
				
			|||||||
        region_min_size = max(model_shape[0], model_shape[1])
 | 
					        region_min_size = max(model_shape[0], model_shape[1])
 | 
				
			||||||
        # compute regions
 | 
					        # compute regions
 | 
				
			||||||
        regions = [
 | 
					        regions = [
 | 
				
			||||||
            calculate_region(frame_shape, a[0], a[1], a[2], a[3], region_min_size, multiplier=1.2)
 | 
					            calculate_region(
 | 
				
			||||||
 | 
					                frame_shape,
 | 
				
			||||||
 | 
					                a[0],
 | 
				
			||||||
 | 
					                a[1],
 | 
				
			||||||
 | 
					                a[2],
 | 
				
			||||||
 | 
					                a[3],
 | 
				
			||||||
 | 
					                region_min_size,
 | 
				
			||||||
 | 
					                multiplier=random.uniform(1.2, 1.5),
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
            for a in combined_boxes
 | 
					            for a in combined_boxes
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # consolidate regions with heavy overlap
 | 
					        # consolidate regions with heavy overlap
 | 
				
			||||||
        regions = [
 | 
					        regions = [
 | 
				
			||||||
            calculate_region(frame_shape, a[0], a[1], a[2], a[3], region_min_size, multiplier=1.0)
 | 
					            calculate_region(
 | 
				
			||||||
 | 
					                frame_shape, a[0], a[1], a[2], a[3], region_min_size, multiplier=1.0
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
            for a in reduce_boxes(regions, 0.4)
 | 
					            for a in reduce_boxes(regions, 0.4)
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user