Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
App.xaml
App.xaml.cs
BitmapTools.cs
CSharpOrNot.cs
CSharpOrNot.csproj
CSharpOrNotProgram.cs
CSharpOrNotWindow.xaml
CSharpOrNotWindow.xaml.cs
DataTools.cs
README.md
TrainCommand.cs
UICommand.cs

README.md

Running the sample

This sample requires TensorFlow 1.14 due to a bug in BatchNormalization layer in 1.10.

  1. Create new Conda environment named tf-1.14: conda create -n tf-1.x python=3.7 (brew cask install miniconda to get conda command)
  2. Activate that environment: conda activate tf-1.14
  3. Install TensorFlow 1.14: python -m pip install "tensorflow==1.14.*"
  4. Navigate to this directory
  5. Set environment variable GRADIENT_PYTHON_ENVIRONMENT to conda:tf-1.14 (e.g. set ... = ... on Windows, export ... = ... on Linux and Mac)
  6. Run dotnet run --framework netcoreapp3.0 -- ui

Using the sample

  1. Download & extract pretrained model from GitHub or train your own (instructions pending)
  2. Launch CSharpOrNot (see above). A dialog will appear to load model weights.
  3. Find weights .index or .hdf5 file to load the model
  4. Click on "Open File..." to load code
  5. Select any source code file from your projects
  6. After it is loaded, move cursor around and watch programming language detected
  7. Click on "Open File..." again to load a different code file (no need to load model again)
You can’t perform that action at this time.