Skip to content

Commit

Permalink
Merge pull request #32 from esavary/repeat-option
Browse files Browse the repository at this point in the history
ENH: More flexible repeat function
  • Loading branch information
esavary authored May 7, 2024
2 parents 066aa34 + 73e80a6 commit 0d9e735
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
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

0 comments on commit 0d9e735

Please sign in to comment.