use tooltips for settings, to explain path usage in particular
This commit is contained in:
19
settings.py
19
settings.py
@@ -53,12 +53,12 @@ settings_schema = SettingsSchema(many=True)
|
||||
################################################################################
|
||||
class SettingsForm(FlaskForm):
|
||||
id = HiddenField()
|
||||
base_path = StringField('Base Path to use below (optional):', [validators.DataRequired()])
|
||||
base_path = StringField('Base Path to use below:', [validators.DataRequired()])
|
||||
import_path = StringField('Path(s) to import from:', [validators.DataRequired()])
|
||||
storage_path = StringField('Path to store sorted images to:', [validators.DataRequired()])
|
||||
recycle_bin_path = StringField('Path to temporarily store deleted images in:', [validators.DataRequired()])
|
||||
default_refimg_model = SelectField( 'default_refimg_model', choices=[(c.id, c.name) for c in AIModel.query.order_by('id')] )
|
||||
default_scan_model = SelectField( 'default_scan_model', choices=[(c.id, c.name) for c in AIModel.query.order_by('id')] )
|
||||
default_refimg_model = SelectField( 'Default model to use for reference images', choices=[(c.id, c.name) for c in AIModel.query.order_by('id')] )
|
||||
default_scan_model = SelectField( 'Default model to use for all scanned images', choices=[(c.id, c.name) for c in AIModel.query.order_by('id')] )
|
||||
default_threshold = StringField('Face Distance threshold (below is a match):', [validators.DataRequired()])
|
||||
submit = SubmitField('Save' )
|
||||
|
||||
@@ -70,6 +70,15 @@ class SettingsForm(FlaskForm):
|
||||
def settings():
|
||||
form = SettingsForm(request.form)
|
||||
page_title='Settings'
|
||||
HELP={}
|
||||
HELP['base_path']="Optional: if the paths below are absolute, then this field is ignored. If they are relative, then this field is prepended"
|
||||
HELP['import_path']="Path(s) to import files from. If starting with /, then used literally, otherwise base path is prepended"
|
||||
HELP['storage_path']="Path(s) to store sorted files to. If starting with /, then used literally, otherwise base path is prepended"
|
||||
HELP['recycle_bin_path']="Path where deleted files are moved to. If starting with /, then used literally, otherwise base path is prepended"
|
||||
HELP['default_refimg_model']="Default face recognition model used for reference images - cnn is slower/more accurate, hog is faster/less accurate - we scan (small) refimg once, so cnn is okay"
|
||||
HELP['default_scan_model']="Default face recognition model used for scanned images - cnn is slower/more accurate, hog is faster/less accurate - we scan (large) scanned images lots, so cnn NEEDS gpu/mem"
|
||||
HELP['default_threshold']="The distance below which a face is considered a match. The default is usually 0.6, we are trying for about 0.55 with kids. YMMV"
|
||||
|
||||
if request.method == 'POST' and form.validate():
|
||||
try:
|
||||
# HACK, I don't really need an id here, but sqlalchemy get weird
|
||||
@@ -90,10 +99,10 @@ def settings():
|
||||
except SQLAlchemyError as e:
|
||||
st.SetAlert( "danger" )
|
||||
st.SetMessage( "<b>Failed to modify Setting:</b> {}".format(e.orig) )
|
||||
return render_template("settings.html", form=form, page_title=page_title)
|
||||
return render_template("settings.html", form=form, page_title=page_title, HELP=HELP)
|
||||
else:
|
||||
form = SettingsForm( obj=Settings.query.first() )
|
||||
return render_template("settings.html", form=form, page_title = page_title)
|
||||
return render_template("settings.html", form=form, page_title = page_title, HELP=HELP)
|
||||
|
||||
##############################################################################
|
||||
# SettingsRBPath(): return modified array of paths (take each path in
|
||||
|
||||
Reference in New Issue
Block a user