Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respect LOCATION_FILTER_THRESHOLD config, adjust sf_thresh range from 0.0001 to 0.99 #100

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def analyzeFile(item):
parser.add_argument('--threads', type=int, default=4, help='Number of CPU threads.')
parser.add_argument('--batchsize', type=int, default=1, help='Number of samples to process at the same time. Defaults to 1.')
parser.add_argument('--locale', default='en', help='Locale for translated species common names. Values in [\'af\', \'de\', \'it\', ...] Defaults to \'en\'.')
parser.add_argument('--sf_thresh', type=float, default=0.03, help='Minimum species occurrence frequency threshold for location filter. Values in [0.01, 0.99]. Defaults to 0.03.')
parser.add_argument('--sf_thresh', type=float, help='Minimum species occurrence frequency threshold for location filter. Values in [0.0001, 0.99]. Defaults to 0.03.')
parser.add_argument('--classifier', default=None, help='Path to custom trained classifier. Defaults to None. If set, --lat, --lon and --locale are ignored.')

args = parser.parse_args()
Expand Down Expand Up @@ -431,7 +431,10 @@ def analyzeFile(item):

# Load species list from location filter or provided list
cfg.LATITUDE, cfg.LONGITUDE, cfg.WEEK = args.lat, args.lon, args.week
cfg.LOCATION_FILTER_THRESHOLD = max(0.01, min(0.99, float(args.sf_thresh)))
if args.sf_thresh is not None:
cfg.LOCATION_FILTER_THRESHOLD = max(0.0001, min(0.99, float(args.sf_thresh)))
if args.sf_thresh is None and cfg.LOCATION_FILTER_THRESHOLD is None:
cfg.LOCATION_FILTER_THRESHOLD = 0.03
if cfg.LATITUDE == -1 and cfg.LONGITUDE == -1:
if len(args.slist) == 0:
cfg.SPECIES_LIST_FILE = None
Expand Down