1d275bddd7349b765db88c76ec7dcfdf85de0f42,aletheialib/attacks.py,,difference,#Any#Any#,132
Before Change
cmask = - mask
cmask[(mask > 0)] = 0
abs_mask = np.abs(mask)
counts = {}
for g in groups(I, mask):
flip = (g + cmask) ^ abs_mask - cmask
result = np.sign(smoothness(flip) - smoothness(g))
if result not in counts:
counts[result] = 0
counts[result] += 1
N = sum(counts.values())
R = float(counts[1])/N
S = float(counts[-1])/N
After Change
// {{{ difference()
def difference(I, mask):
pool = Pool(multiprocessing.cpu_count())
analysis = pool.map(RSAnalysis(mask).call, groups(I, mask))
pool.close()
pool.join()
counts = [0, 0, 0]
for v in analysis:
counts[v] += 1
N = sum(counts)
R = float(counts[1])/N
S = float(counts[-1])/N
return R-S
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: daniellerch/aletheia
Commit Name: 1d275bddd7349b765db88c76ec7dcfdf85de0f42
Time: 2020-11-07
Author: kevin.clark@gmail.com
File Name: aletheialib/attacks.py
Class Name:
Method Name: difference
Project Name: deepfakes/faceswap
Commit Name: acc6553f80d17469bedfdcdab2ea676478a49d9d
Time: 2019-07-04
Author: 36920800+torzdf@users.noreply.github.com
File Name: tools/effmpeg.py
Class Name: Effmpeg
Method Name: get_fps
Project Name: numerai/submission-criteria
Commit Name: 3bf5f2de89807642dcd1e030e45226ff3944779b
Time: 2017-11-10
Author: xander@numer.ai
File Name: database_manager.py
Class Name: DatabaseManager
Method Name: get_everyone_elses_recent_submssions