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

ENH: More flexible repeat function #32

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 7 additions & 5 deletions qkay/qkay.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,10 @@ def assign_dataset():
app.logger.debug("User %s selected for inspection", username)
randomize = request.form.get("option_randomize")
app.logger.debug("Randomize %s", randomize)
rate_all = request.form.get("option_rate_all")
app.logger.debug("Repeat images %s", rate_all)
repeat = request.form.get("option_repeat")
app.logger.debug("Repeat images %s", repeat)
number_rep = int(request.form.get("repeat_count"))
app.logger.debug("Number of repetitions %s", number_rep)
blind = request.form.get("option_blind")
app.logger.debug("Blind inspection %s", blind)
random_seed = random.randint(0, 100000)
Expand All @@ -913,8 +915,8 @@ def assign_dataset():
"%s reports found at %s", len(names_files), dataset_path
)
new_names = names_files
if rate_all:
names_repeated = repeat_reports(new_names, 40)
if repeat:
names_repeated = repeat_reports(new_names, number_rep)
else:
names_repeated = names_files
if randomize:
Expand All @@ -935,7 +937,7 @@ def assign_dataset():
username=username,
randomize=randomize,
blind=blind,
rate_all=rate_all,
rate_all=repeat,
names_files=names_files,
names_shuffled=names_shuffled,
names_anonymized=names_anonymized,
Expand Down
9 changes: 7 additions & 2 deletions qkay/templates/assign_dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ <h2>Assign dataset</h2>
<label class="form-check-label" for="check1">Randomize</label>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="check2" name="option_rate_all" value=True>
<label class="form-check-label" for="check2">Repeat images</label>
<input type="checkbox" class="form-check-input" id="check2" name="option_repeat" value="True">
<label class="form-check-label" for="check2">Repeat images</label>
<div class="input-group">
<label class="input-group-text" for="repeat_count">Number of repetitions</label>
<input type="number" class="form-control" id="repeat_count" name="repeat_count" value="0" min="0">
</div>
</div>

<div class="form-check">
<input type="checkbox" class="form-check-input" id="check3" name="option_blind" value=True>
<label class="form-check-label">Blind inspection</label>
Expand Down