Loading...
'; echo ''; } ?>
Leave feedback 1/4
Please leave feedback here to help us make this site better; you can choose to be anonymous.
We look over the feedback to know how we can improve the site and get what users want.
 
Do you want to be anonymous when leaving feedback?
Check for Yes
Next
Leave feedback 2/4
What is your overall impression of the layout?
Terrible AWESOME!!!
 
How easy is it to navigate the site?
Extremely easy How do I get out of here?
Next
Leave feedback 3/4
What is your overall impression of the functionality?
You call that functionality? Excellent!
 
How easy was it to understand what the site is about?
I still have no clue. I knew it before I came here!
Next
Leave feedback 4/4
Leave comments or suggestions here.
Send
Something went wrong; please check that you have marked all questions.
Start Forum Posts Leaderboard More















Mutation

Logged Out
Leaderboard coming soon

Engineering Solutions for the Church

Christian Engineering Solutions (CES) is a Not for Profit Organization specializing in collaborative solutions development for the Church. In the Spirit of Jesus Christ, we are to spread the gospel throughout the Earth, taking care to be good examples of Christ Jesus by serving others. CES is designed to help the Church meet these goals in the most rigorous manner possible.

Our Technology

Our Technology is scripture based in its goals and foundations. Open-Source and Free, one may use our services to both learn and solve problems with the goals of helping others and growing closer to God.

Features

Merit-based Reputation and Rewards

Streamlined Search and Citations

Modular Applications

Peer-to-Peer and Encryption Technologies (Under Development)

External Repository

https://github.com/ChristianEngineeringSolutions/ChristianEngineeringSolutions


Setup Account with email to earn rewards from reputation and donations.
Projects/Source Code
nsfw.js

ADMIN
One Way , 8/8/2024
   Project in Projects/Source Code
(async function(){
  console.log("Beginning video scanning.");
  const mongoose = require('mongoose');
  require('dotenv').config();
  // mongoose.connect('mongodb://127.0.0.1:27017/sasame', {
  //     useNewUrlParser: true,
  //     useCreateIndex: true,
  //     useFindAndModify: false,
  //     useUnifiedTopology: true
  // });
  const User = require('./models/User');
  const Passage = require('./models/Passage');
  const axios = require("axios");
  const https = require('https');
   const http = require('http');
  axios.create({
            httpAgent: new http.Agent({keepAlive: true}),
        });
  const tf = require("@tensorflow/tfjs-node");
  const nsfw = require("nsfwjs");
  var fs = require('fs'); 
  // var passage = await Passage.findOne({_id: process.argv[4].toString()});
  var passage = {flagged:false};
  // var request = require('request').defaults({ encoding: null });
  if(process.argv[5] == 'image'){
    const pic = await axios.get('http://localhost:3000/'+process.argv[2], {
      responseType: "arraybuffer",
    });
    console.log("Got pic.");
    const model = await nsfw.load(); // To load a local model, nsfw.load('file://./path/to/model/')
    // Image must be in tf.tensor3d format
    // you can convert image to tf.tensor3d with tf.node.decodeImage(Uint8Array,channels)
    const image = await tf.node.decodeImage(pic.data, 3);
    const predictions = await model.classify(image);
    image.dispose(); // Tensor memory must be managed explicitly (it is not sufficient to let a tf.Tensor go out of scope for its memory to be released).
    console.log(predictions);
    console.log("_ID: " + process.argv[4]);
    passage.isPorn = predictions[3].probability;
    passage.isHentai = predictions[4].probability;
    if(passage.isPorn > 0.6 || passage.isHentai > 0.6){
      passage.flagged = true;
    }
  }else if(process.argv[5] == 'video'){
    console.log("ISVIDEO");
    //process each screenshot
    for(var i = 1; i < 4; ++i){
      const pic = await axios.get('http://localhost:3000/'+ process.argv[3] + '/' + process.argv[6] + '_' + i + '.png', {
        responseType: "arraybuffer",
      });
      const model = await nsfw.load();
      const image = await tf.node.decodeImage(pic.data, 3);
      console.log("Processing Screenshot " + i);
      // Image must be in tf.tensor3d format
      // you can convert image to tf.tensor3d with tf.node.decodeImage(Uint8Array,channels)
      // const image = await tf.node.decodeImage(pic2.data, 3);
      const predictions = await model.classify(image);
      image.dispose(); // Tensor memory must be managed explicitly (it is not sufficient to let a tf.Tensor go out of scope for its memory to be released).
      console.log(predictions);
      // var passage = await Passage.findOne({_id: process.argv[4].toString()});
      passage.isPorn = predictions[3].probability;
      passage.isHentai = predictions[4].probability;
      if(passage.isPorn > 0.6 || passage.isHentai > 0.6){
        passage.flagged = true;
        break;
      }
    }
  }
    // delete flagged media
    if(passage.flagged){
        fs.unlink('dist/'+process.argv[2], function(err){
          if (err && err.code == 'ENOENT') {
              // file doens't exist
              console.info("File doesn't exist, won't remove it.");
          } else if (err) {
              // other errors, e.g. maybe we don't have enough permission
              console.error("Error occurred while trying to remove file");
          } else {
              console.info(`removed flagged media.`);
          }
      });
    }
    // await Passage.findOneAndUpdate({_id:process.argv[4]}, {flagged: passage.flagged});
    // await passage.save();
    console.log("Done.");
})();

0 Stars